3 ms·
Something surprising about C is that an empty argument list doesn't mean "no arguments", it means "unspecified arguments". https://stackoverflow.com/questions/
by nitrogen 9y ago
Something surprising about C is that an empty argument list doesn't mean "no arguments", it means "unspecified arguments".
https://stackoverflow.com/questions/693788/is-it-better-to-use-c-void-arguments-void-foovoid-or-not-void-foo https://stackoverflow.com/questions/693788/is-it-better-to-u...
Though that is unlikely to be related to the arguments passed to main.
- nineteen999 9y agoThe 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 9y 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 9y agoI took a detour at the footnote reference, and never came back. Interesting to note, thank you.