首页 开发工具 VSCode vscode运行程序结果框闪退

vscode运行程序结果框闪退

Feb 12, 2020 pm 03:46 PM
vscode 闪退

vscode运行程序结果框闪退

问题:

用VS写c/c++程序,运行结果框总是会一闪而退,根本看不到程序运行的结果。

解决方法:

1、在return 0;语句之前, 加上一个 getchar();语句, 如此,getchar会一直等待输入,程序运行结果框也就正常显示运行结果了。

51723bd5af27dbe6a900ac5e156ff39.png

2、在程序末尾加上语句:system("pause");,再加上头文件 #include,这样运行结果后就会显示结果,并提示请按任意键继续。

585fb80304eddbf27ba22162f3e9de3.png

8e264782ee6073b2919220928e68ffe.png

3、修改项目配置,右键点击项目,在右键菜单中选择属性,然后在弹出的对话框左侧列表中选择 “配置属性--->链接器--->系统”,然后在右侧的列表中,在第一项 “子系统”的值中 选择 “控制台(/SUBSUSTEM:CONSOLE)”

8680e3aa1b9565d7e45fcdf9a3b9dff.png

相关学习推荐:vscode教程

以上是vscode运行程序结果框闪退的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

热门话题

PHP教程
1596
276
如何在Windows上安装VSCODE 如何在Windows上安装VSCODE Jul 27, 2025 am 03:16 AM

Gotohttps://code.visualstudio.comanddownloadtheWindowsUserInstaller.2.Runthe.exefile,allowchanges,andselectrecommendedoptionsincludingaddingtoPATHandcreatingadesktopshortcut.3.ClickFinishtolaunchVSCodeafterinstallation.4.Optionallyinstallusefulextens

Vscode和Visual Studio之间有什么区别 Vscode和Visual Studio之间有什么区别 Jul 30, 2025 am 02:38 AM

VSCodeisalightweight,cross-platformcodeeditorwithIDE-likefeaturesviaextensions,idealforwebandopen-sourcedevelopment;2.VisualStudioisafull-featured,Windows-onlyIDEdesignedforcomplex.NET,C ,andenterpriseapplications;3.VSCodeperformsfasteronlower-endma

如何在VSCODE中使用参数运行Python脚本 如何在VSCODE中使用参数运行Python脚本 Jul 30, 2025 am 04:11 AM

TorunaPythonscriptwithargumentsinVSCode,configurelaunch.jsonbyopeningtheRunandDebugpanel,creatingoreditingthelaunch.jsonfile,andaddingthedesiredargumentsinthe"args"arraywithintheconfiguration.2.InyourPythonscript,useargparseorsys.argvtoacce

VSCODE用户设置在哪里? VSCODE用户设置在哪里? Jul 24, 2025 am 02:02 AM

VSCode用户设置存储位置取决于操作系统,通常位于用户配置文件下的特定目录。Windows路径为C:\Users$$用户名]\\AppData\\Roaming\\Code\\User\\settings.json,macOS为/Users\$$用户名]/Library/ApplicationSupport/Code/User/settings.json,Linux为/home$$用户名]/.config/Code/User/settings.jso

如何将VSCODE与WSL(Linux的Windows子系统)一起使用 如何将VSCODE与WSL(Linux的Windows子系统)一起使用 Aug 01, 2025 am 06:26 AM

InstallWSLandaLinuxdistributionbyrunningwsl--installinPowerShellasAdministrator,thenrestartandsetuptheLinuxdistribution.2.Installthe"Remote-WSL"extensioninVSCodetoenableintegrationwithWSL.3.OpenaprojectinWSLbylaunchingtheWSLterminal,navigat

如何更改VSCODE中的字体大小? 如何更改VSCODE中的字体大小? Aug 02, 2025 am 02:37 AM

TochangethefontsizeinVSCode,useoneofthesemethods:1.OpenSettingsviaCtrl ,(orCmd ,onMac),searchfor"fontsize",andadjustthe"Editor:FontSize"value.2.OpenSettings(JSON)fromtheCommandPalette,thenaddormodify"editor.fontSize":e.g

如何在VSCODE中调试单元测试 如何在VSCODE中调试单元测试 Aug 01, 2025 am 06:12 AM

CreateModifyLaunch.JSONINVSCODEBYOPENEDTHERUNANDDEBUGVIEW,SELECTingYourenVironment(例如Python,Node.js)和ConconfiguringItfo ryourtestframework(例如,pytest,jest)。2。setbreakpointsinyourtestfile,selectthedebuggconfiguration,andstartdebuggingwithf5topaus

如何更改VSCODE中的字体大小 如何更改VSCODE中的字体大小 Jul 26, 2025 am 04:13 AM

tochangetheTsizeInvScode,gotofile>“首选项”>“设置”,搜索“ fontsize”,andmodifythe“ editor:fontsize” value.2

See all articles