C: Would the following program compile?
Would the following program compile?
struct syntax
{
int i ;
float g ;
char c ;
}
main( )
{
printf ( "I won't give you any error" ) ;
} The above program successfully compiles and on execution prints the message given in printf( ). In the above program the structure syntax is declared but not terminated with the statement terminator, the semicolon. The compiler does not give any error message for it. This is because the compiler assumes that main( ) function has a return type of struct syntax and hence it successfully compiles and executes the program.




Comments
Log in or create a user account to comment.