Compiling with int main(void) fails; main(int argc, char *argv[]) succeeds. Why?
问题 Problem Why would compiling a program which has an int main(void) main function differ from compiling a program which has an int main(int argc, char *argv[]) main function, if the program does not use arguments passed on the command line? Is this OS or compiler specific? I do not get the same results using mingw and g++ (which is weird isn't it as wingw is a port of gcc) . Example Code #include <iostream> #include"SDL/SDL.h" int main(void) { return 0; } Compilation commands g++ test.cpp; #g++