c++ - Are nameless parameters in main() strictly conforming? -


c++ allows following 2 definitions of main:

int main() { } int main(int argc, char* argv[]) { } 

it allows char*[] char** , argc , argv named whatever programmer wishes. however, allow:

int main(int, char*[]) { } 

is identical above examples? strictly conforming? note, don't care if compiles in favorite compiler, i'm asking standards only.

yes, stated @captain obvlious, c++ cares type of parameters. c++ standard committee papers publicly available here reference.

3.6.1 main function

  1. an implementation shall not predefine main function. function shall not overloaded. shall have return type of type int, otherwise type implementation-defined. all implementations shall allow both

— function of () returning int and

— function of (int, pointer pointer char) returning int


Comments

Popular posts from this blog

json - Zend error Connection -

javascript - Trigger mouseenter when an animated element touches mouse -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -