问题
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