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

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

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