by kccqzy · 1y ago · 0 comments
In C `int main()` means the function takes an unknown number of arguments. You need `int main(void)` to mean it doesn't take any arguments. This is a fact frequently forgotten by those who write C++.
It's not really relevant for main() though, even in older C versions main() works fine and simply means "I don't need argc and argv".
> 14. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters.
https://stackoverflow.com/questions/156767/whats-the-differe...
In C I guess that's true. In languages more concerned with compile-time rigor, it often isn't. Not a correction, just an observation.
Of course de-facto things are more nunanced.