Code: ------ int x,x; int main(){ int x,x; x = 10; return 0; } In this code ... if i commented out the local declaration of "int x,x;" (inside main) the code compiling successfuly.. But if commented out global ones and not local one's we will get compilation error for the same variables name declaration... Can sb let me know the resoning behind the same.
Probably a compiler bug. The error message is correct and you should get it for both faulty declarations. What compiler are you using?
That completely doesn't answer the question. Why would I need to? It's invalid code. Anyway, since you can't be arsed to find out how to make gcc print its version, I can't be arsed either.