Codes:
#define MAX_BUFFER_SIZE 1000
int ch = 0, alpha [25] = {0}, buffer[MAX_BUFFER_SIZE] = {0} ,count = 0;
....
while ((ch = (fgetc(stream)))!=EOF)
{
buffer [count] = ch;
count++;
}
printf("%d", alpha [25]);
.....
The problem is: alpha [25] contains buffer [0], (alpha[25] is supposed to be 0). which suggests that the memory space allocated for alpha[25] is also the starting memory space of buffer[0]!!! How could this be? I am ultimately confused. Is there anything wrong with my computer?
Any help is deeply thanked.