I am reading The C Programming Language
and the first program is to print Hello World
I wrote the code as it shown in the book:
#include <stdio.h>
main()
{
printf("hello, world\n");
}
But I got an error warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main()
. I fixed it by writing the code like this:
#include <stdio.h>
int main()
{
printf("hello, world\n");
}
Can anyone tell me what is the difference and why should I write it like that?