<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>蜗牛的家 &#187; c c++</title>
	<atom:link href="http://www.genepeng.cn/index.php/category/technic/c-cpp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.genepeng.cn</link>
	<description></description>
	<lastBuildDate>Wed, 30 Nov 2011 14:52:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>QT 学习笔记</title>
		<link>http://www.genepeng.cn/index.php/219</link>
		<comments>http://www.genepeng.cn/index.php/219#comments</comments>
		<pubDate>Tue, 20 Oct 2009 03:40:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c c++]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/index.php/219</guid>
		<description><![CDATA[The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals or slots. Classes that use the Q_OBJECT macro must have moc run on them. This isn&#8217;t a problem because qmake automatically adds the necessary rules to the makefile. But if you forget to regenerate your makefile using [...]]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/219/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c++ 学习笔记</title>
		<link>http://www.genepeng.cn/index.php/191</link>
		<comments>http://www.genepeng.cn/index.php/191#comments</comments>
		<pubDate>Thu, 24 Sep 2009 07:31:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c c++]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/index.php/191</guid>
		<description><![CDATA[1. Never Return a Pointer to a Local Object 2. Function Declarations Go in Header Files It may be temptingand would be legalto put a function declaration directly in each source file that uses the function. The problem with this approach is that it is tedious and error-prone. By putting function declarations into header files, [...]]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/191/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>const Objects Are Local to a File By Default</title>
		<link>http://www.genepeng.cn/index.php/186</link>
		<comments>http://www.genepeng.cn/index.php/186#comments</comments>
		<pubDate>Mon, 21 Sep 2009 09:21:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c c++]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/index.php/186</guid>
		<description><![CDATA[When we define a nonconst variable at global scope, it is accessible throughout the program. We can define a nonconst variable in one file andassuming an appropriate declaration has been madecan use that variable in another file: // file_1.cc int counter; // definition // file_2.cc extern int counter; // uses counter from file_1 ++counter; // [...]]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/186/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c/c++写cgi之helloworld</title>
		<link>http://www.genepeng.cn/index.php/145</link>
		<comments>http://www.genepeng.cn/index.php/145#comments</comments>
		<pubDate>Wed, 12 Aug 2009 02:51:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[c c++]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[c/c++写cgi之helloworld]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/index.php/145</guid>
		<description><![CDATA[最近比较闲，所以又回头来学习下c/c++, 但看来看去也没什么好学的，没什么项目，光学一门语言确实没什么好看的，那就来用c/c++写个cgi来玩玩吧，之前没做过cgi，所以这样就既可了解cgi又可复习c/c++了。 先来个c/c++的cgi hello world吧，本人是在apache下运行的啊 新建文件hello.c #include &#60;stdio.h&#62; main() { &#160;&#160;&#160; printf(&#34;Content-type:text/html\n\n&#34;); &#160;&#160;&#160; printf(&#34;Hello,World!&#34;); } 用命令$gcc –o hello hello.c 生成 hello 然后查看apache配置文件httpd.conf, 设置为：[默认的差不多就是这样] ScriptAlias /cgi-bin/ &#34;/var/www/cgi-bin/&#34; &#60;Directory &#34;/var/www/cgi-bin&#34;&#62; &#160;&#160;&#160; AllowOverride All &#160;&#160;&#160; Options ExecCGI &#160;&#160;&#160; Order allow,deny &#160;&#160;&#160; Allow from all &#60;/Directory&#62; 然后把生成的hello复制到 /var/www/cgi-bin/下，如果修改了配置的话，就先重起apache, 这时输入http://localhost/cgi-bin/hello,就应该可以看到结果了]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/145/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>make_pair</title>
		<link>http://www.genepeng.cn/index.php/55</link>
		<comments>http://www.genepeng.cn/index.php/55#comments</comments>
		<pubDate>Sun, 05 Apr 2009 14:09:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c c++]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[make_pair]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/?p=55</guid>
		<description><![CDATA[关于make_pair(1, &#8220;Test&#8221;)为什么有错： 1 先声明一些东西： template &#60;typename T1, typename T2&#62; struct pair { T1 first; T2 second; // &#8230; }; template &#60;typename T1, typename T2&#62; pair&#60;T1, T2&#62; make_pair(T1 const&#38;, T2 const&#38;); 2 当调用make_pair(1, &#8220;Test&#8221;)时 2.1 类型推导 #1 T1 = int; #2 由于&#8221;Test&#8221;的类型是char const[5]， 而且函数参数T2 const&#38;是引用， 所以T2 = char const[5] 2.2 实例化函数 pair&#60;int, char const[5]&#62; make_pair&#60;&#62;(int const&#38;, [...]]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/55/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>内存分配方式</title>
		<link>http://www.genepeng.cn/index.php/30</link>
		<comments>http://www.genepeng.cn/index.php/30#comments</comments>
		<pubDate>Sun, 22 Mar 2009 08:36:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c c++]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[内存分配]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/?p=30</guid>
		<description><![CDATA[内存分配方式有三种： （1） 从静态存储区域分配。内存在程序编译的时候就已经分配好，这块内存在程序的整个运行期间都存在。例如全局变量，static 变量。 （2） 在栈上创建。在执行函数时，函数内局部变量的存储单元都可以在栈上创建，函数执行结束时这些存储单元自动被释放。栈内存分配运算内置于处理器的指令集中，效率很高，但是分配的内存容量有限。(不要用return 语句返回指向“栈内存”的指针，因为该内存在函数结束时自动消亡) char *GetString(void) { char p[] = &#8220;hello world&#8221;; return p; // 编译器将提出警告 } void Test4(void) { char *str = NULL; str = GetString(); // str 的内容是垃圾 cout&#60;&#60; str &#60;&#60; endl; } 下面这种方式可以避免这种情况： char *GetString2(void) { char *p = &#8220;hello world&#8221;; return p; } void Test5(void) { char *str [...]]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>引用与指针的比较</title>
		<link>http://www.genepeng.cn/index.php/26</link>
		<comments>http://www.genepeng.cn/index.php/26#comments</comments>
		<pubDate>Sun, 22 Mar 2009 08:23:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c c++]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[引用]]></category>
		<category><![CDATA[引用与指针]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/?p=26</guid>
		<description><![CDATA[引用和指针的区别在于下面几点： １. 创建引用时必须初始化，而且不能初始化为null; 　而指针可以不初始化，也可以初始化为null int &#38;a;　//error, references must be initialized int *p; //right int &#38;a = NULL; //error, can&#8217;t init as NULL int *p = NULL; //right 2. 引用初始化后，就不再改变;　而指针随时可以改变所指的对象。 int a = 1; int b = 2; int &#38;r = a;　//r成为a的引用，即别名，r恒为a 的引用，不可改变 r = b;//此时不要以为r变成了b的引用，而是把b的值赋给了a, 此是a, r 都为b的值２ r = 3;//a, r的值都变成了３，b的值不变，仍为２ 指针却是可以随时改变所指的对象 int a [...]]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/26/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sizeof</title>
		<link>http://www.genepeng.cn/index.php/16</link>
		<comments>http://www.genepeng.cn/index.php/16#comments</comments>
		<pubDate>Sun, 08 Mar 2009 15:13:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c c++]]></category>
		<category><![CDATA[c c++ sizeof]]></category>
		<category><![CDATA[sizeof]]></category>

		<guid isPermaLink="false">http://www.genepeng.cn/?p=16</guid>
		<description><![CDATA[c语言里的sizeof 是一个计算数据存储空间大小的单目运算符，它返回数据所占的字节个数，　我们可以先来看看ＭＳＮＤ里的定义： sizeof Operator sizeof expression The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type (including aggregate types). This keyword returns a value of type size_t. The expression is either an identifier or a type-cast expression (a type specifier enclosed in parentheses). When applied to a structure [...]]]></description>
		<wfw:commentRss>http://www.genepeng.cn/index.php/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

