argv[0] is the pointer to the initial character of a null-terminated multibyte strings that represents the name used to invoke the program itself (or, if this is not supported by the execution environment, argv[0][0] is guaranteed to be zero).
argv[0] is the pointer to the initial character of a null-terminated multibyte strings that represents the name used to invoke the program itself (or an empty string "" if this is not supported by the execution environment).
First you have to know how to create a process. Taking the Windows platform as an example, the standard is to create it through CreateProcess CreateProcess MSDN: https://msdn.microsoft.com/zh-cn/library/ms682425(v=vs.85).aspx
The first parameter is the absolute path of the program, and the second is the command line parameter. If the first parameter exists and the second is empty, then argv will be empty.
Under Linux, the internal implementation is mainly
That is, arg is empty. In Windows, open the Task Manager and select Show command line parameters. There are many system processes that do not have command line parameters.
In most cases, at least one command line argument is itself.
argv[0] is the pointer to the initial character of a null-terminated multibyte strings that represents the name used to invoke the program itself (or, if this is not supported by the execution environment, argv[0][0] is guaranteed to be zero).
http://en.cppreference.com/w/c/language/main_function
argv[0] is the pointer to the initial character of a null-terminated multibyte strings that represents the name used to invoke the program itself (or an empty string "" if this is not supported by the execution environment).
http://en.cppreference.com/w/cpp/language/main_function
First you have to know how to create a process.
Taking the Windows platform as an example, the standard is to create it through CreateProcess
CreateProcess MSDN: https://msdn.microsoft.com/zh-cn/library/ms682425(v=vs.85).aspx
The first parameter is the absolute path of the program, and the second is the command line parameter. If the first parameter exists and the second is empty, then argv will be empty.
Under Linux, the internal implementation is mainly
That is, arg is empty.
In Windows, open the Task Manager and select Show command line parameters. There are many system processes that do not have command line parameters.
In most cases, at least one command line argument is itself.