Main function parameter ARGC,ARGV description

Source: Internet
Author: User

The main function in C + + language, often with parameter argc,argv, is as follows:

int main (int argc, char** argv)
int main (int argc, char* argv[])

The effect of these two parameters: ARGC is the number of command line input parameters (separated by whitespace ) argv stores all command-line arguments if your program is hello.exe, if you run the program at the command line, you should first enter the command line with the CD command The directory where the Hello.exe file is located) runs the command:

Hello.exe Shiqi Yu

So, the value of ARGC is 3,argv[0] is "hello.exe", Argv[1] is "Shiqi", argv[2] is "Yu".

See http://wiki.opencv.org.cn/index.php/Main function parameter argc,argv description

Main function parameter ARGC,ARGV description

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.