﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava--随笔分类-cc++</title><link>http://www.blogjava.net/forker/category/26121.html</link><description>幸福 这么远 那么甜.</description><language>zh-cn</language><lastBuildDate>Mon, 24 Sep 2007 07:40:47 GMT</lastBuildDate><pubDate>Mon, 24 Sep 2007 07:40:47 GMT</pubDate><ttl>60</ttl><item><title>c++打印Hello World</title><link>http://www.blogjava.net/forker/archive/2007/09/24/147799.html</link><dc:creator>forker</dc:creator><author>forker</author><pubDate>Mon, 24 Sep 2007 07:05:00 GMT</pubDate><guid>http://www.blogjava.net/forker/archive/2007/09/24/147799.html</guid><wfw:comment>http://www.blogjava.net/forker/comments/147799.html</wfw:comment><comments>http://www.blogjava.net/forker/archive/2007/09/24/147799.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/forker/comments/commentRss/147799.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/forker/services/trackbacks/147799.html</trackback:ping><description><![CDATA[
		<br />编写一个创建时,就在屏幕上打印Hello,消失时,就打印Goodbye 的C++程序.<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">iostream</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />using namespace std;<br /><br /></span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> World{<br />        </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">:<br />                World(){</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">创建时</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                        std::cout</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Hello!\n</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />                }<br />                </span><span style="color: rgb(0, 0, 0);">~</span><span style="color: rgb(0, 0, 0);">World(){</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">消失时</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                        std::cout</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Goodbye!\n</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />                }<br />};<br /><br />//World theWorld;<br /><br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> main(){<br />        //cout</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Hello World\n</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />        World theWorld;<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />}<br /></span></div><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">[root@portal ctest]# vi hello.c<br />[root@portal ctest]# g</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);"> hello.c </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">o hello<br />[root@portal ctest]# .</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">hello<br />Hello</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);"><br />Goodbye</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);"><br />[root@portal ctest]#<br /></span></div><br /><img src ="http://www.blogjava.net/forker/aggbug/147799.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/forker/" target="_blank">forker</a> 2007-09-24 15:05 <a href="http://www.blogjava.net/forker/archive/2007/09/24/147799.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>