【问题标题】:why can't I take input while debugging in VS code?为什么我在 VS 代码中调试时不能接受输入?
【发布时间】:2022-11-17 11:47:06
【问题描述】:
#include<stdio.h>
int main()
{  
   int a,b,c;
   scanf("%d %d",&a,&b);
   c=a+b;
    printf("%d\n",c);

return 0;
}

这是我的简单程序。当我处于调试模式时,我的终端不接受输入。在这里我附上我的 launch.json 设置。enter image description here

当我不处于调试模式时,我可以在终端中输入。当我调试程序时出现这个问题。我已经设置了我的“externalConsole”:true,但它毕竟不起作用。

【问题讨论】:

    标签: c++ debugging visual-studio-code input terminal


    【解决方案1】:

    打开设置面板:在搜索设置中输入:runInTerminal 选项勾中,重启VS就可以了。

    【讨论】:

    • 你能用英语解释这个答案吗,因为这是一个只有英语的网站?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-25
    • 2017-01-10
    • 2015-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多