Hi, I'm just wondering if this is the correct way to pass a pointer in a for loop:
say I have the following variables. (don't worry about functions not having prototypes etc, this is only an example).
int x = 0;
firstPointer = &x; // firstPointer now points to x, x holds the value 0.
if (x == 2)
array[(*firstPointer)-1] = 5; // basically says 'array[2-1] = 5'; aka 'array = 5'
for (*firstPointer=1; *firstPointer <= 3; *firstPointer++) // sets the value of x to 1 etc?
if (*firstPointer == 2) // basically saying if the value of x is 2?
So basically at the end of this program array will be holding the value 5, if i'm correct :P
so yeah, hope i didn't confuse everyone too much -_- thanks.