Possible Duplicate:
difference between main(void) and main() in c
I know this is super basic and some other threads already talked about similar questions. But I have a book (Absolute Beginners Guide to C) where all the code is written within the function main(). The int is always left out. How is that possible to run? Is that ok with maybe an older version of stdio.h?
Here is the sample code:
#include <stdio.h>
main() // not int main()
{
printf("This is it\n");
return 0;
}
I think the c89 standard will allow main() but c99 and above won’t . You have to use int main() otherwise .