方法1
打開.vscode中l(wèi)aunch.json文件
修改下面三個配置
"program":"C:\\Windows\\System32\\cmd.exe",
"args": ["/C","${fileDirname}\\${fileBasenameNoExtension}.exe","&","pause"],
"externalConsole": true,
以非調(diào)試模式運行,ctrl+F5
方法2
打開.vscode中l(wèi)aunch.json文件
修改"externalConsole": true,
在main函數(shù)中最后加入getchar()函數(shù)
文章來源:http://www.zghlxwxcb.cn/news/detail-827437.html
注:方法2如果只修改externalConsole為true終端會一閃而過文章來源地址http://www.zghlxwxcb.cn/news/detail-827437.html
到了這里,關(guān)于vscode運行c++結(jié)果輸出在windows終端的兩種方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!