关于int main( int argc, char* argv[] ) 中arg和argv参数的解析及调试
https://blog.csdn.net/LYJ_viviani/article/details/51873961
https://stackoverflow.com/questions/3024197/what-does-int-argc-char-argv-mean
#include <iostream> int main(int argc, char** argv) { std::cout << "Have " << argc << " arguments:" << std::endl; for (int i = 0; i < argc; ++i) { std::cout << argv[i] << std::endl; } }
g++ main.cc 编译后
运行他将./test a1 b2 c3
输出