【发布时间】:2011-05-11 17:33:19
【问题描述】:
可能重复:
How to stop C++ console application from exiting immediately?
我刚开始在学习 C++ 时使用 Visual Studio 2010。当我编译并运行我的代码时,我会短暂地看到命令提示符出现在屏幕上,然后消失,并在调试器中看到以下内容,无论我在.cpp 文件中写了什么。
'c++ lessons.exe': Loaded 'C:\Users\User\Documents\Visual Studio 2010\Projects\c++ lessons\Debug\c++ lessons.exe', Symbols loaded.
'c++ lessons.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'c++ lessons.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'c++ lessons.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'c++ lessons.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'c++ lessons.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The program '[5904] c++ lessons.exe: Native' has exited with code 0 (0x0).
我进行了一些搜索,试图为自己找到解决方案。但是,大多数建议都涉及添加暂停或等待输入等技巧,我尝试过 Ctrl + F5。有没有办法可以在 Visual Studio 中设置构建和运行过程以显示命令提示符?
【问题讨论】:
-
忘记了。有趣的是,我一直在说同样的话。至少我是一致的!
标签: c++