(1) The first int represents the return value of the entire main function, and if the function is executed normally, returns 0, and the exception returns 1.(2) int ARGC represents the total number of command line parameters, since is the number,
Reprinted from
Http://www.opencv.org.cn/index.php/Main%E5%87%BD%E6%95%B0%E5%8F%82%E6%95%B0argc%EF%BC%8Cargv%E8%AF%B4%E6%98%8E
The main function in C/C ++ often carries the argc and argv parameters, as follows:
Int main (INT argc, char ** argv)
Int
The main function in C + + language, often with parameter argc,argv, is as follows:
Copy Code code as follows:
int main (int argc, char** argv)
What are the roles of these two parameters? ARGC refers to the number of command
VB6.0 provides the command () interface to provide support for command line parameters. Therefore, all input parameters can be obtained through the command () function, but it is unfriendly, all the parameters of VB are combined and become a string.
Main (int Argc,char *argv[])1.ARGC is an integer2.ARGV pointer to pointer (can be understood as:char **argv or:char *argv[] Or:char argv[][], argv is an array of pointers )Note: the main () parenthesis is a fixed notation.3. Here is an example to
The main function in C/C ++ often carries the argc and argv parameters, as follows:
Int main (INT argc, char ** argv)
What are the functions of these two parameters? Argc refers to the number of input parameters in the command line. argv stores
ARGC is the abbreviation for argument count, which indicates the number of arguments passed into the main function;ARGV is the abbreviation for the argument vector, which represents the parameter sequence or pointer passing in the main function, and
1. Parameters(sometimes the parameter is void)ARGC is the number of parameters when the program runsARGV is an array of stored parameters, which can be used with char* argv[] or char **argv.For example, compiling a hello.c program1 #include 2 int
Original address: 51987413ARGC is the abbreviation for argument count, which indicates the number of arguments passed into the main function;ARGV is an abbreviation for the argument vector, indicating that the parameter sequence or pointer passed in
ARGC indicates the number of argumentsArgs expresses an array of strings that store parameters for each string type. (This type is useful)The effect of these two main parameters is only when the corresponding program is opened with a DOS small black
# Include
# Include
/* Argc is the number of external command parameters, and argv [] stores the content of each parameter */
Int main (INT argc, char * argv [])
{
Int A, B, C;
If (argc = 1 | argc> 3)
Return 0;
Cout
Cout
Cout
#include int main(int argc, char *argv[]){ int i; printf("argc=%d\n",argc); for(i=0; i%s\n",i,argv[i]); } return 0;}
Description: argc is the number of input parameters, and argv is a pointer array. The above function is
You can use command line variables -- $ argv and $ argc in php. you can use command line variables in php. Too many words are too abstract to speak with the script:
Echo $ argv [1]. "\ n ";
Echo $ argv [2]. "\ n ";
Echo $ argc. "\ n ";
Print_r
Occasionally interested in the parameters of the main function, write a program for verification.
Int main (int argc, char ** argv)
First, two points are explained:
First, the system will store the parameter list, that is, the command we input under
Arg in ArgC and Argv refers to " parameters "(Foreign Languages:arguments, argument counter and Argument vector )ARGC: Integer that is used to count the number of command-line arguments sent to the main function when you run the program * argv[]:
ARGC,ARGV useful when compiling programs with the command lineWe will find such parameters in the timed task script, $obj->run ($argv [1]);
*/30 * * * */usr/local/bin/php/htdocs/test.com/uaqm/commands/test.php 1 >/dev/null 2>&1
Just like the timed
Main (INT argc, char * argv []) parameter meaning
# Include using namespace STD; int main (INT argc, char * argv []) {int I; for (I = 0; I
CMD window:
It can be seen that argv stores the CMD input command
Argc records the number of
For cmd command I know nothing, today see seniors use, Record:>CD file name//to this fileFile address plus >DR//Get the directory of the fileFile address plus > filename. exe//runs the file, which is the. exe file generated by the C + + programIf
Tag: Main Parameter DoS
Previously, we saw that all main (INT argc, char * argv []) programs need to enter commands in the doscommand status, and do not know how to open dos, so we have never tried, I met another one today, so I decided to study it.
int main (intChar*Char*env[]) 1. int argcIndicates how many arguments you have when you enter a command at the command line.2. Char *argv[]Represents the storage path for this executable file, the program variable.His first element is argv[0]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.