Re:What happens before main() is executed in C and why is it...
by nineteen999 on Sunday May 06, 2018 @06:48PM
(#17009073)
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, 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.
Re:What happens before main() is executed in C and why is it...
by JdeBP on Tuesday May 08, 2018 @06:21PM
(#17025818)
It actually has a whole other half to the sentence, following the semi-colon.
Re:What happens before main() is executed in C and why is it...
by nineteen999 on Tuesday May 15, 2018 @02:47AM
(#17072112)
I took a detour at the footnote reference, and never came back. Interesting to note, thank you.
https://stackoverflow.com/questions/693788/is-it-better-to-u...
Though that is unlikely to be related to the arguments passed to main.