|
Re: How do i put all of the relay inputs into an array?
Quote:
Originally Posted by amateurrobotguy
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
|