Hi guys
I have three separate, non-related code that each give out a certain value that I can't just figure why....
could you help me with them?
Code:
int arr[] = {5,6,7,8,9,10};
int x = 1;
int *p = arr + 2 ; //I have mainly problem with definition of this line
p--;
x = p[x]
this one gives you 7.
the other is a segment : it's to give you 15...why???
Code:
for( i= 3; i != 15; i= i + 2);
and the last gives you just zero. I'm not sure if I totally understand the while(0) loop?
Code:
int main(void) {
int r = -1 ;
while (r++) {
printf("r = %d \n", r);
}
return 0;
}
I'd be grateful for any help