首页 > 解决方案 > vs code c/c++调试卡住,只显示在调用栈中运行,不显示任何变量

问题描述

VS Code C/C++ 调试卡住了,它只显示在调用堆栈中运行并且不显示任何变量请帮助我是新手。

这是我的 launch.json 文件

"version": "0.2.0",
"configurations": 
[

{
    "name": "(Windows) Launch",
    "type": "cppvsdbg",
    "request": "launch",
    "program": "${workspaceFolder}/return0.exe",
    "args": [],
    "stopAtEntry": true,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "externalConsole": false
},

]    

这是我保存为 return0.c 的两个数字之和的代码

#include<stdio.h>
#include<conio.h>
int main()
{
    {
     int a,b,c;
     printf("Enter two No.\n");
     scanf("%d%d",&a,&b);
     c=a+b;
     printf("the sum is %d",c);
    }
    return 0;
}

标签: c++visual-studio-codevscode-debugger

解决方案


推荐阅读