vs下程式執行結果框閃退的三種解決方案
1.getchar()
在return 0 之前一行getchar();因為getchar()會一直等待使用者輸入
#include <iostream>
using namespace std;
int main() {
cout << "hello world!" << endl;
getchar();
return 0;
}
2.在程式末尾新增語句:system("pause"); 再加上標頭檔案#include <stdlib.h>,這樣執行結果後就會顯示結果,並提示“請按任意鍵繼續”
#include <iostream> #include <stdlib.h> using namespace std; int main() { cout << "hello world!" << endl; return 0; system("pause"); }
3.修改專案配置,右鍵點選專案,在右鍵選單中選擇屬性,然後在彈出的對話方塊左側列表中選擇“配置屬性”-->“連結器”-->“系統”,然後在右側的列表中,在第一項”子系統“的值中選擇”控制檯(/SUBSUSTEM:CONSOLE)“
最後程式會執行成這個樣子
加油!!
相關推薦
vs下程式執行結果框閃退的三種解決方案
1.getchar() 在return 0 之前一行getchar();因為getchar()會一直等待使用者輸入 #include <iostream> using namespace std; int main() { cout << "hello world!
Windows下Zookeeper啟動zkServer.cmd 閃退問題的解決方案
部落格引用處(以下內容在原有部落格基礎上進行補充或更改,謝謝這些大牛的部落格指導): Windows下Zookeeper啟動zkServer.cmd閃退問題的解決方案 Zookeeper在Windows下啟動只需要執行zkServer.cmd雙擊即可(需保證執行環境中正確安裝了Java執
Windows下Zookeeper啟動zkServer.cmd閃退問題的解決方案
Zookeeper在Windows下啟動只需要執行zkServer.cmd雙擊即可(需保證執行環境中正確安裝了Java執行環境) 但是在有的時候會出現雙擊閃退的情況。針對閃退,可按照一下步驟進行解決
資料庫同步備份神器kettle遇到Spoon.bat 閃退問題的解決方案
現象:雙擊Spoon.bat執行,進入kettle啟動介面,幾秒鐘後軟體自動退出,命令窗抓屏檢視資訊內容為: DEBUG: Using JAVA_HOME DEBUG: _PENTAHO_JAVA_HOME=C:\Program Files\Java\jdk1.8.0._65 DEBUG: _PEN
Tomcat閃退問題常見解決方案
Tomcat下載解壓完成後, 雙擊bin 中 的startup.bat 後閃退: 解決步驟1: 出現第一個dos視窗時閃退: 第一步:右鍵點選startup.bat , 選擇編輯 , 在最後一行加上
MacBook升級到OSX 10.13 下執行Android Simulator失敗的一種解決方案
作者:天涯來客:iOS_Android 開發專案技術服務 一、背 景 MacBook配置如下: 之前的OSX版本為 10.6,Android studio在此版本下Emulator執行正常。 由於目前OSX版本已升級為10.13
Python2.x編譯器列印中文出現亂碼的三種解決方案(本人以VS2017與VS Code為例,使用其他整合開發工具的也可參考下)
本文主要介紹了三種解決方案: 解決方案一:在需要列印的中文字元前加個u,用於標識所要列印的是一個Unicode字串。(我感覺著一種方法是最簡單和省事的,並且使用其他整合開發工具的若遇到類似的問題,也應該可以使用這種方法解決,具體大家可以在下方評論)(測試此方法不適合在Vis
WIN10 GIT BASH 閃退問題終極解決方案
這兩天,終於受不了自己電腦的卡頓,又由於工資不夠也沒發沒有錢更新自己的裝置,所以選擇了自己重灌了系統。自己手動重灌了win10 64位的純淨版系統,其實一點也不純淨。重灌完畢,更新驅動,解除安裝垃圾軟體,填補漏洞…… 進入正題,重灌了Git,在安裝的過程中,沒有出現錯誤,但
input file選擇檔案上傳後清空選擇框檔案資訊兩種解決方案
上傳檔案時,選擇了檔案後想清空檔案路徑。用兩種方法解決 <input type="file" id="fileupload" name="file" /> 第一種: var obj =
執行緒間操作無效: 從不是建立控制元件的執行緒訪問它的三種解決方法
今天遇到這個問題,百度了下,把解決的方法總結出來。 我們在ui執行緒建立的子執行緒操作ui控制元件時,系統提示錯誤詳細資訊為: 執行緒間操作無效: 從不是建立控制元件“XXX”的執行緒訪問它。 就我知道的有三種方法,先看一下msdn的介紹: 訪問 Windows 窗
VS 2013程式點選Ctrl+F5執行出現執行視窗閃退現象的解決方法
用VS2013建立一個C++空專案的時候會出現執行視窗閃退的現象,百度一下找到解決方案 1.首先,右擊解決方案下專案名稱,選擇屬性 2.在連結器--->系統中找到子系統,將子系統選擇成控制檯, 3.然後點選Ctrl+F5,就可以運行了
關於ios使用執行緒導致程式不規律的閃退問題解決
之前自己寫的一個小專案,使用支執行緒的目的就是為了一些運算 或者伺服器間的互動。 [NSThreaddetachNewThreadSelector:@selector(setLoadData)toTarget:selfwithObject:nil]; 開啟一個執行緒
JDK11下tomcat 9啟動閃退問題的解決辦法
問題說明,雙擊tomcatbin目錄下的startup.bat檔案後,cmd視窗閃退,沒有啟動tomcat服務,下面說明解決辦法 我用的jdk11版本,安裝後沒有jre資料夾,tomcat服務只需要jdk和jre兩者之一就可以了 假設jdk環境變數配置成功,jdk的環境變數主要配置兩項,JA
linux 下程式執行時出現的 error while loading shared libraries
Linux中error while loadin 預設情況下,編譯器只會使用/lib和/usr/lib這兩個目錄下的庫檔案,通常通過原始碼包進行安裝時,如果不指定--prefix,會將庫安裝在/usr/local/lib目錄下;當執行程式需要連結動態庫時,提示找不到相關的.s
VSCode的Python擴充套件下程式執行的幾種方式與環境變數管理
在VSCode中編寫Python程式時,由於有些地方要使用環境變數,但是發現設定的環境變數有時不起作用,花了點時間研究了一下,過程不表,直接說結論。 首先,環境變數的設定,Python擴充套件中有三種方式: 直接設定系統環境變數,或在使用命令列啟動VSCode時臨時先設定環境變數。這種方式設定的環境變
Android Studio裡設定了按鈕,開發到手機上,點開按鈕,卻發現沒有跳到下一個介面,而是閃退的原因
如果你在介面設定了按鈕,開發到手機上,點開按鈕,卻發現沒有跳到下一個介面,而是閃退。 原因是因為你沒有在左圖的xml檔案裡把結果的目標activity這3行寫進去。寫進去之後再重新下載到手機上,就可以了。
避免程式出現 unrecognized selector 閃退問題
給NSObject新增分類加入程式碼+(void)load{Method method1 = class_getInstanceMethod(self.class, @selector(methodSignatureForSelector:));Method method2
BootStrap模態框閃退
解決方法: 1、bootstrap.min.js與modal.js不能混用。 2、觸發模態框的元件需要設定 data-toggle=“modal” 3、設定 data-target="#myModal"或href="#myModal"或者寫javascript 函式響應點選
正確配置java jdk環境變數方式 及 配置tomcat後執行startup.bat閃退原因分析
我們用的很多軟體都需要配置環境變數,有的軟體會自動配置環境變數,不需要我們手動配置.而有的必須手動配置環境變數,比如git, eclipse等. 下面分享一下正確配置java環境變數的方法.因為很多軟體的執行都需要基於配置java環境變數的基礎上. 以配置jdk1.8
安卓開發問題一:在虛擬機器上執行APP不能執行,即閃退現象
在執行程式時,出現了虛擬機器上開啟自己寫的APP,提示不能執行,也就是閃退的現象。找了好多論壇,基本上是模擬器與API版本不同導致的,我的後來換了一個AVD裝置,莫名其妙的就自己好了 現將解決方法整理如下: 1、project->clean(測試無用) 2、在Mai