In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "argc,argv and C/C++ easy wrong problem analysis", the explanation content in the article is simple and clear, easy to learn and understand, please follow the small series of ideas slowly in-depth, together to study and learn "argc,argv and C/C++ easy wrong problem analysis" bar!
argc is argument count. As the name suggests, is the number of parameters entered by the user on the command line.
argv is argument vector. is the vector library of parameters entered by the user (array)
int main(int argc ,char *argv[])
char *argv[] is a pointer array ([] has higher priority than *, so each element in it is char* type, to understand the difference between char (*argv)[] and char *argv[]), each element, stored are parameters, these parameters are strings. It's actually a vector library. If you don't understand this for a while, don't worry, look down.
It actually records the parameters passed in when the program is executed. Including the statement that opens the program. If I save a program called test.exe, execute it on the command line with a few parameters:
test.exe x y z
In this case, argc is four parameters, namely text.exe, x, y, z. The output would look like this:
Code:
#include
using namespace std;
int main(int argc, char* argv[]) {
cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.