这个问题是对这个问题的延伸。 Eclipse Debug run and console run of the same program give different outputs
给一点背景...... 在解析NTP应用程序的输出时,我在字符串输出中发现了一些相当奇怪的东西。我正在使用的环境是在调试模式下使用CDT进行eclipse,将控制台输出重定向到终端(/ dev / pts / 0),并将fish作为shell运行。
我发现的地方...... 带有起始字符或字符串的字符串,如*,+,&,^。比如当我尝试这样的时候。
cout << "+123" << endl; //does not get printed
cout << "*123" << endl; //does not get printed
cout << "&123" << endl; //Concatenates with string below (without the line feed)
cout << "|123" << endl; //^
cout << "^123" << endl; //Does not get printed
另外
cout << "abcdef" << endl << endl;
没有两个换行的预期效果;只打印一个。
当我通过终端运行程序时...
~$ ./Project/Debug/Project
一切正常,按预期工作。
这是预期的行为吗,我不知道的事情是什么? 或者这是一个错误,腐败还是某种性质的东西? 或者我做错了什么?
P.S:我可能偶然遗漏了一些细节,请阅读提供的关于赶上的链接中的问题。