The role of int main(int argc, char* argv[])

main(int argc, char* argv[]): argc indicates the number of all parameters in spaces when the file is running. The argv[] array holds all strings at once.

for example:

test one two three<回车>

argc = 3,从0-3,argv[0] = test,argv[1]=one,argv[2]=three;

This thing was handed down in the DOS era. The program is followed by parameters. Generally, the program needs parameters or needs to operate the target.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325170114&siteId=291194637