In fact: int main (INT argc, char * argv []) is a standard writing method in UNIX and Linux, while int main () is only a default usage in UNIX and Linux ..
Void main (INT argc, char * argv []) is equivalent to void main (INT argc, char ** argv)
Take a look at the example of testargc. C and you will understand their usage:
# Include <unistd. h>
# Include <stdio. h>
Int main (INT argc, char * argv [])
{
If (argc = 1)
Printf ("argc = 1 \ nargv [0] = % s \ n", argv [0]);
If (argc = 2)
Printf ("argc = 2 \ nargv [0] = % s \ nargv [1] = % s \ n", argv [0], argv [1]);
If (argc = 3)
Printf ("argc = 3 \ nargv [0] = % s \ nargv [1] = % s \ nargv [2] = % s \ n", argv [0], argv [1], argv [2]);
// Exit (0 );
}
Run: #./testargc
Result: argc = 1.
Argv [0] =./testargc
Run: #./testargc test1
Result: argc = 2.
Argv [0] =./testargc
Argv [1] = test1
Run:./testargc test1 Test2
Result: argc = 3.
Argv [0] =./testargc
Argv [1] = test1
Argv [2] = Test2
Here we can see how argc and argv [] are used. argc is the number of external command parameters, and argv [] stores the content of each parameter.
Argc in Main Function