View Single Post
  #5   Spotlight this post!  
Unread 13-12-2007, 00:11
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
Re: How to manipulate a variable value using an array?

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
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).

Last edited by amateurrobotguy : 13-12-2007 at 00:36.