好的,我知道我可以像这样循环:
for (int i=1; i<=argc-1;i++) { cout << argv[i] << endl; }
但这种方式会丢失双引号,即字符串"something here"被视为args数组的一个元素,并且引号丢失.
"something here"
好吧,我知道如果参数里面有空格,我可以假设引号,但无论是否有空格,引号总是丢失.
c++ console mingw
c++ ×1
console ×1
mingw ×1