The console output of my vscode looks strange, how to fix it?

China☆狼群 提交于 2021-01-29 07:18:46

问题


I am using vscode to write c++ programs in macOS. However I find it hard to debug, and the output of the console is always out of format.

My code is like

#include <stdio.h>
#include <iostream>
using namespace std;
int
main()
{
   printf("Hello World\nWelcome to go to C++\n");
   cout << "hello world" << endl;
   return 0;
}

And the output of the console is

=thread-selected,id="1"
@"Hello World\r\n"
@"Welcome to go to C++\r\n"
@"hello world\r\n"

So is there any configuration I forget to set? Or there's another problem?

Please tell me how to fix that.


回答1:


This looks like it is correctly formatted, in that the newlines are where they were specified. Although the line endings printed look different.

Perhaps this thread https://github.com/Microsoft/vscode/issues/2957 can help with user configuration settings to set line endings.



来源:https://stackoverflow.com/questions/54122584/the-console-output-of-my-vscode-looks-strange-how-to-fix-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!