I tried the below c program & I expected to get compile time error, but why compiler isn't giving any error?
#include <stdio.h>
int main(void)
{
printf("%d
");
return 0;
}
Why output is compiler dependent?
Here is the output on various compilers
Output on Orwell Dev C++ IDE (uses gcc 4.8.1) : 0
Output on Visual C++ provided by Visual Studio 2010 : 0
CodeBlocks IDE (uses gcc 4.7.1) : garbage value
Online compiler ideone.com : garbage value
What is going wrong here ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…