int main(int argc,char **argv)
- argc:命令行参数个数(Argument Count)
- argv:命令行参数向量(Argument Vector)
argv是一个字符串数组,双指针代表指向首个字符串的地址和字符串中每个字符的地址,类似双层数组,但是不太一样,具体的是一个叫系统预设类型的
其中argv[0]代表的是exe文件当前的地址
g++ test.cpp -o run
.\run.exe mapreduce
C:\Users\85032\Desktop\code\d_mapduce\run.exe
cout << argv << " " << *argv<< " " << &argv << " " << argv[0] << " " << *argv[0]<< " " << &argv[0]<< " " << argv[0][0]<< " " <<&argv[0][0] <<endl; cout<< typeid (argv).name() <<" "<<typeid (argv[0]).name() <<" "<<typeid (argv[0][0]).name() <<endl;0xe615e0 C:\Users\85032\Desktop\code\d_mapduce\run.exe 0x61fe38 C:\Users\85032\Desktop\code\d_mapduce\run.exe C 0xe615e0 C C:\Users\85032\Desktop\code\d_mapduce\run.exe
PPc Pc c