作者waha (waha)
看板C_and_CPP
标题[问题] c++超级新手的问题
时间Fri Apr 24 21:57:16 2009
第一天看就碰到问题@@
我是用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
1F:推 gozha:system("pause"); 04/24 22:00
2F:推 Peruheru:加上一楼打得那行程式,你就看得到结果了 04/24 22:12
3F:→ waha:我加了 可是还是一样@@ 跑出来一下 瞬间就不见了 04/24 22:19
4F:推 Peruheru:你加在哪?要加在return 0; 之前喔 04/24 22:26
5F:→ waha:喔喔 我试出来了 谢谢~~ 04/24 22:34
6F:推 Peruheru:return 0;这行程式一执行,後面的其它程式码就会失效了 04/24 22:36
7F:→ andyleeyuan:注解可以不用打出来啦 XD 04/25 11:52