View Single Post
  #3   Spotlight this post!  
Unread 12-12-2007, 23:03
Phil Mack Phil Mack is offline
Registered User
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: May 2007
Rookie Year: 2007
Location: Maryland
Posts: 30
Phil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to behold
Re: How do i put all of the relay inputs into an array?

Quote:
Originally Posted by amateurrobotguy View Post
how can a store variable names within an array
You can store the address of the variable in the array, then use that address as a pointer to the value you want to print. Your array would be declared as an array of pointers.
myVar = 1;
array[1] = &myVar;

(*)(array[1]) = 2;
printf("%d\n",myVar);
Good luck,
~Phil

Last edited by Phil Mack : 13-12-2007 at 02:33. Reason: changed printf to assume myVar is an int