Quote:
Originally Posted by amateurrobotguy
I need you to confirm if what I am thinking is correct:
myVar = 1; Establish the "shell" as being = 1
array[1] = &myVar; Let the 1st value of array[] = the address of the "shell"
(*)(array[1]) = 2; the * means modify/check the contents of the address of myVar
printf(*myVar); since the shell wasn't updated, the * is needed to display the contents of the address of myVar since printf(myVar) would return 1
|
That would put a '2' in the memory cell pointed to by the address in array[1]. Or in this case....since the address in array[1] is that of myVar, the value of myVar would be 2, so assuming myVar is an int, your code for printing it out would be:
Code:
printf("%d\n",myVar);
Which would print out '2'.