Mail Archives: djgpp/1998/11/10/06:14:03
On Tue, 10 Nov 1998, Daniel Mironowicz wrote:
> int main(void)
> {
> int ptr[10];
> int p = ptr[1], // check out the ending of this line
> getch(); // if you remove this line gcc displays error msg
> }
This is not a bug in the compiler. It is porfectly valid C to say this:
int p = ptr[1], getch();
This is the same as these two lines:
int p = ptr[1];
int getch();
When you remove getch(), the line "int p = ptr[1]," becomes invalid C, so
the compiler complains.
Where's the bug?
- Raw text -