I have some question on pointers that i dont quite understand what is happening, here is my pretend array and pointer and some declares:
int *i_pointer;
int some_array[10];
some_array[0] = 10;
some_array[1] = 22;
i_pointer = &some_array[0];
Ok stop me when im wrong.. *i_pointer is initialized to point to position 0 in the array, and as such it has a value of 10 if i was to,
*i_pointer++;
this would make i_pointer point to position 2 in the array and thus have a value of 22, then if i was to,
(*_pointer)* 2));
this would = 22 * 2 thus giving *i_pointer a value of 44, so then if i was to look into the array position 0 would have a value of 10 and position 1 would have a value of 44.
Well ok this might not be a question as such but my understanding of how this is working, what i dont know and am guessing is that when you increment the position the pointer is pointing to that it takes on the value of that position in the array. Just making sure what im doing is right and not all folly, thanks again in advance for your assistance.
int *i_pointer;
int some_array[10];
some_array[0] = 10;
some_array[1] = 22;
i_pointer = &some_array[0];
Ok stop me when im wrong.. *i_pointer is initialized to point to position 0 in the array, and as such it has a value of 10 if i was to,
*i_pointer++;
this would make i_pointer point to position 2 in the array and thus have a value of 22, then if i was to,
(*_pointer)* 2));
this would = 22 * 2 thus giving *i_pointer a value of 44, so then if i was to look into the array position 0 would have a value of 10 and position 1 would have a value of 44.
Well ok this might not be a question as such but my understanding of how this is working, what i dont know and am guessing is that when you increment the position the pointer is pointing to that it takes on the value of that position in the array. Just making sure what im doing is right and not all folly, thanks again in advance for your assistance.