Has anyone ever tried to make this a data type besides int or void? Like this:
char main()
double main()
Printable View
Has anyone ever tried to make this a data type besides int or void? Like this:
char main()
double main()
NO!!!!
The ANSI standard for the main function is:-
int main(int argc, char *argv[])
ie returns an integer. This is why the main function always terminates with return 0;
a lot of compilers allow you to miss out the return data type and just declare main(), and some compilers (wrongly) allow you to declare main as void.
I suspect that if you tried to return a character (if it got past the compiler) the os would interpret it as an integer and throw up an error message.