Parameters in the main function (argc, *argv[])

Foreword: The main function is often used, but I haven't paid much attention to its parameters. I encountered a problem by chance today, so I went to understand it and record it here.
main function Baidu Encyclopedia

The two formal parameters of the main function: argc is of type int, which records the number of commands and parameters, argv is a pointer to a pointer, and each pointer in the pointer array points to a string. Where argv[0] is the program name and contains the address.
Insert picture description hereInsert picture description hereIn the case of the command line
Insert picture description here

Guess you like

Origin blog.csdn.net/lthahaha/article/details/106674450