Hello everyone, I have some questions about the difference between the value of an array, and the array itself.
eg:
1 2 3 4 5 6 7
//This code will assign the value of [element 1] + 1 to the variable "value1".
constint size = 3;
int array[size] = {1,2,3};
int value1;
value1 = array[1] + 1; //thus, the value that value1 holds is 3.
Nothing. That result is just discarded since you aren't assigning it to anything.
'array' is really just a pointer. You can add to a pointer, and you can access another element in the array by using an offset, but you don't assign 'array + 1' to anything, so the temporary result is thrown away.
ohh i see, I got it now.
I was writing a program with array, and I mistakenly wrote array + 1 instead of array[value] + 1, and my program outputted some random values, then I got curious of this.