我的 vscode 的控制台输出看起来很奇怪,如何解决? [英] The console output of my vscode looks strange, how to fix it?

查看:70
本文介绍了我的 vscode 的控制台输出看起来很奇怪,如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 vscode 在 macOS 中编写 c++ 程序.但是我发现很难调试,并且控制台的输出总是格式错误.

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.

我的代码就像

#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;
}

控制台的输出是

=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.

推荐答案

这看起来格式正确,因为换行符是指定的位置.虽然打印的行尾看起来不同.

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

也许这个线程https://github.com/Microsoft/vscode/issues/2957 可以帮助用户配置设置以设置行尾.

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

这篇关于我的 vscode 的控制台输出看起来很奇怪,如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆