"void main()" is nonstandard and therefore nonportable.
void main()
Yes, alas, I know that this appears in many books. Some authors even argue that "void
main()" might be standard-conforming. It isn't. It never was, not even in the 1970s, in the
original pre-standard C.
Even though "void main()" is not one of the legal declarations of main, many compilers allow
it. What this means, however, is that even if you are able to write "void main()" today on your
current compiler, you may not be able to write it when you port to a new compiler. It's best to
get into the habit of using either of the two standard and portable declarations of main:
int main()
int main( int argc, char* argv[] )