Reputation: 22156
In GCC the following C code compiles correctly-
int i = 7;
i = 5i;
printf("%d", i);
And prints- 0
.
The statement i = 5i
clearly makes no sense. Then why on earth the code does not give any compilation error? And why i
becomes 0
?
Upvotes: 1
Views: 303
Reputation: 272537
This is a GCC extension for representing the imaginary component of complex numbers.
The compiler complains if you compile with -pedantic
and -Werror
: http://ideone.com/PMlZr5.
Upvotes: 7