[問題] c++超級新手的問題

看板C_and_CPP (C/C++)作者 (waha)時間16年前 (2009/04/24 21:57), 編輯推噓4(403)
留言7則, 4人參與, 最新討論串1/1
第一天看就碰到問題@@ 我是用dev 5.0 我把螞蟻書上的第一個範例打一次 然後按執行 可是命令提示字源只有跳出來一下下 不到1秒吧 然後又消失了 請問是什麼問題呢? 程式碼是: //FIG. 2.1: fig02_01.cpp //text-printing program #include<iostream>//allows program to output data to the screen //function main begins program execution int main() { std::cout<< "welcome to c++!\n";//display message return 0 ; // indicate that program ended succesfully }//end function main -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 58.114.133.26

04/24 22:00, , 1F
system("pause");
04/24 22:00, 1F

04/24 22:12, , 2F
加上一樓打得那行程式,你就看得到結果了
04/24 22:12, 2F

04/24 22:19, , 3F
我加了 可是還是一樣@@ 跑出來一下 瞬間就不見了
04/24 22:19, 3F

04/24 22:26, , 4F
你加在哪?要加在return 0; 之前喔
04/24 22:26, 4F

04/24 22:34, , 5F
喔喔 我試出來了 謝謝~~
04/24 22:34, 5F

04/24 22:36, , 6F
return 0;這行程式一執行,後面的其它程式碼就會失效了
04/24 22:36, 6F

04/25 11:52, , 7F
註解可以不用打出來啦 XD
04/25 11:52, 7F
文章代碼(AID): #19ySKz47 (C_and_CPP)
文章代碼(AID): #19ySKz47 (C_and_CPP)