So today I figured (for the first time admittedly) that int foo()
is in fact different from int foo(void)
in that the first one allows any
In standard conform C, you have to use int foo(void)
if the function does not accept any parameters.
I guess it is compiler dependant what happens, when you pass arguments to a function with empty braces. But I don't think there is a way to access these parameters.
As for main, the only standard conform (pure c) ways to write them are either int main(void)
or int main(int argc, char **argv)
(or char *argv[] which is the same).