3 ms·
The C standard says arguments to main() should be defined as: int main(void) or int main(int argc, char *argv[]) (or equivalent, eg. int can be replac
by nineteen999 9y ago
The C standard says arguments to main() should be defined as:
int main(void)
or
int main(int argc, char *argv[])
(or equivalent, eg. int can be replaced by a typedef name
defined as int, or the type of argv can be written as
char ** argv).
From http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf, Section 5.1.2.2.1: Program startup)
EDIT: apologies for the atrocious formatting, but it wasn't clear to me how to put two asterisks in a sequence here on HN without preformatted text.
- JdeBP 8y agoIt actually has a whole other half to the sentence, following the semi-colon. * http://jdebp.eu./FGA/legality-of-void-main.html http://jdebp.eu./FGA/legality-of-void-main.html
- nineteen999 8y agoI took a detour at the footnote reference, and never came back. Interesting to note, thank you.