作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 vscode 编辑器的新手,我想运行如下所示的简单 C 项目,但是当我运行时,此调试控制台如下所示。我想知道如何以正确的方式运行。
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
[New Thread 3076.0x2314]
[New Thread 3076.0x20c4]
Thread 1 hit Breakpoint 1, 0x00401603 in main ()
[Thread 3076.0x20c4 exited with code 0]
[Inferior 1 (process 3076) exited normally]
The program 'c:\Users\Lenovo\Desktop\Example\a.exe' has exited with code 0 (0x00000000).
(这是test.c文件)
#include <stdio.h>
int main()
{
printf("hellow world");
return 0;
}
我配置了tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "build Hello"
}
]
}
这是我配置的 launch.json 代码:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:/MinGW/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
这是我的 c_cpp_properties.json 文件:
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/test.c",
"C:/MinGW/lib/gcc/i686-w64-mingw32/7.2.0/include/c++",
"C:/MinGW/lib/gcc/i686-w64-mingw32/7.2.0/include/c++//tr1",
"C:/MinGW/lib/gcc/i686-w64-mingw32/7.2.0/include/c++/i686-w64-mingw32"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceFolder}/test.c",
"C:/MinGW/lib/gcc/i686-w64-mingw32/7.2.0/include/c++",
"C:/MinGW/lib/gcc/i686-w64-mingw32/7.2.0/include/c++//tr1"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
最佳答案
它只是想告诉你一切都很顺利。返回值 0 表示“无错误”。
不过,“hello”中有一个拼写错误,后面的“w”不应该出现。
并且 main()
的参数应该是 (void)
或 (int argc, char *argv[])
。
关于c - 程序 'c:\...\a.exe' 已退出,代码为 0 (0x00000000),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47474290/
我是一名优秀的程序员,十分优秀!