int 0x80

gorlist@int0x80:~$ cat news.txt

int main(void)
Quoting the c99 standard: Program startup
1 The function called at program startup is named main. The implementation declares no
prototype for this function. It shall be defined with a return type of int and with no
int main(void) { /* ... */ }
or with two parameters (referred to here as argc and argv, though any names may be
used, as they are local to the function in which they are declared):
int main(int argc, char *argv[]) { /* ... */ }
or equivalent;9) or in some other implementation-defined manner.

So in C, int main(void) is the only acceptable way of declaring main() in case that it takes no arguments.
In C++, int main() is the equivalent of C's int main(void).

int main() is different from int main(void).
int main() means that it takes an unknown number of arguments, as opposed to int main(void) which means that it takes no arguments.

More here:
Posted on 15 Dec 2007 by gorlist

email: * (will not be published)
The company that makes Windows

Copyright © gorlist 2007-2017