• VScode运行程序弹出小黑窗


    1. 首先要下载运行C环境的相关插件,以及C/C++ Compile Run这个插件

    ![image.png](https://img-blog.csdnimg.cn/img_convert/8909a1e345edde6758787f80453fbb5c.png#clientId=u5e733858-5749-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=377&id=ub86f8d2f&margin=[object Object]&name=image.png&originHeight=377&originWidth=884&originalType=binary&ratio=1&rotation=0&showTitle=false&size=69866&status=done&style=none&taskId=uce06276e-b876-472b-a71c-2b3ae042e1d&title=&width=884)

    2.进入 文件>首选项>设置>扩展>C/C++ Compile Run 中的 Run-in-external-terminal 复选框勾上

    ![image.png](https://img-blog.csdnimg.cn/img_convert/3a57461e4b49bf6a817942edab23fac7.png#clientId=u5e733858-5749-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=533&id=u8ebe65a8&margin=[object Object]&name=image.png&originHeight=533&originWidth=778&originalType=binary&ratio=1&rotation=0&showTitle=false&size=44883&status=done&style=none&taskId=u6345562b-31a4-4b0b-bb5e-7d0dae3e720&title=&width=778)

    3. 打开vscode工程目录就可以在.vscode目录下看到lauch.json文件,如果没有则需要点击调试位置,如图位置1;单击配置按钮,如图位置2,系统便会自动生成配置文件

    ![image.png](https://img-blog.csdnimg.cn/img_convert/2305c1c379fb788170f34299a720ee0e.png#clientId=u5e733858-5749-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=407&id=ucaebd313&margin=[object Object]&name=image.png&originHeight=407&originWidth=374&originalType=binary&ratio=1&rotation=0&showTitle=false&size=19938&status=done&style=none&taskId=uec37760f-1581-4ff0-9150-3c1d238413f&title=&width=374)

    4. 在launch.json文件中加入:"externalConsole": true,或者将launch.json文件中的console后的内容改为externalTerminal,即:**"console": "externalTerminal"**

    ![image.png](https://img-blog.csdnimg.cn/img_convert/e17896dad03cf2d9c90a503f529c7d0d.png#clientId=u5e733858-5749-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=471&id=u06cba1d9&margin=[object Object]&name=image.png&originHeight=471&originWidth=1098&originalType=binary&ratio=1&rotation=0&showTitle=false&size=50152&status=done&style=none&taskId=u76b8306c-5fec-4cb5-bb72-85c508b338b&title=&width=1098)

    5. VScode运行时小黑框闪退

    则需要添加代码语句将程序暂停几秒
    C/C++语句:在编码中 return 0;前添加 sysem(pause);或者getchar()
    ![image.png](https://img-blog.csdnimg.cn/img_convert/0d503f2c939b9064a95c74b02eb417f8.png#clientId=u5e733858-5749-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=748&id=uae62deee&margin=[object Object]&name=image.png&originHeight=748&originWidth=1322&originalType=binary&ratio=1&rotation=0&showTitle=false&size=141825&status=done&style=none&taskId=u4eea3347-7cda-4289-9609-2f28b3cd652&title=&width=1322)

  • 相关阅读:
    银行 Zabbix 监控架构分享
    聚观早报 | iPhone14或于9月23日上市;腾讯发布Max 二代机器人
    聚乙烯亚胺偶联乳清白蛋白/肌白蛋白/豆清白蛋白/蓖麻蛋白/豌豆白蛋白1b ( PA1b)科研试剂
    设计模式——20. 解释器模式
    【树莓派不吃灰】命令篇⑨ 记录学习文件系统
    【双指针-中等】167. 两数之和 II - 输入有序数组
    ElasticSearch集群服务器配置
    项目中传递达梦JdbcDriver的依赖
    中台框架模块开发实践-用 Admin.Core 代码生成器生成通用代码生成器的模块代码
    大学生开学必备物品清单男生2022 大学生开学必备物品男生
  • 原文地址:https://blog.csdn.net/luck_gid/article/details/125894651