Here is the code:
#include <stdio.h>
int main (void)
{
int value[10];
int index;
value[0] = 197;
value[2] = -100;
value[5] = 350;
value[3] = value[0] + value[5];
value[9] = value[5] / 10;
--value[2];
for(index = 0; index < 10; ++index)
printf("value[%i] = %i\n", index, value[index]);
return 0;
}
Here's the compilation output:
value[0] = 197
value[1] = 0
value[2] = -101
value[3] = 547
value[4] = 0
value[5] = 350
value[6] = 0
value[7] = 0
value[8] = 1784505816
value[9] = 35
I do not understand why the value [8] returns 1784505816? Does the value [8] = the value [6] = the value [7] = 0? By the way, I am compiling code through gcc under Mac OS X Lion.
source
share