Even if the signature is main(int argc, char *argv[])
, it is not uncommon to see int main()
. This works because C is not particularly strict in verifying the signatures of external functions (however that may be: when you call an external function in C, you simply point to the function and argument list, there is no way it can really verify that you are using this function as it was originally defined.)
So this will work too:
int main(int argc) { return 0; }
Even this will be:
int main(int argc, char *argv[], int foo) { return 0; }
just don't expect the meaningful value to appear in foo
.
source share