如果我用以下main()方法运行我的c++应用程序,一切都是OK的:
int main(int argc, char *argv[])
{
cout << "There are " << argc << " arguments:" << endl;
// Loop through each argument and print its number and value
for (int i=0; i<argc; i++)
cout << i << " " << argv[i] << endl;
return 0;
}
我得到了我想要的,我的论点也被打印出来了。
然而,如果我使用_tmain:
int _tmain(int argc, char *argv[])
{
cout << "There are " << argc << " arguments:" << endl;
// Loop through each argument and print its number and value
for (int i=0; i<argc; i++)
cout << i << " " << argv[i] << endl;
return 0;
}
它只显示每个参数的第一个字符。
造成这种情况的差异是什么?