<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Liang's Dev Zone</title>
	<atom:link href="http://liangdev.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://liangdev.wordpress.com</link>
	<description>坚持，敏感，创新，平衡，勤奋，聪明，开阔，诚信！</description>
	<lastBuildDate>Wed, 24 Jun 2009 03:12:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='liangdev.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Liang's Dev Zone</title>
		<link>http://liangdev.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://liangdev.wordpress.com/osd.xml" title="Liang&#039;s Dev Zone" />
	<atom:link rel='hub' href='http://liangdev.wordpress.com/?pushpress=hub'/>
		<item>
		<title>[C++ Primer Reading]动态内存分配和指针</title>
		<link>http://liangdev.wordpress.com/2009/06/24/c-primer-reading%e5%8a%a8%e6%80%81%e5%86%85%e5%ad%98%e5%88%86%e9%85%8d%e5%92%8c%e6%8c%87%e9%92%88/</link>
		<comments>http://liangdev.wordpress.com/2009/06/24/c-primer-reading%e5%8a%a8%e6%80%81%e5%86%85%e5%ad%98%e5%88%86%e9%85%8d%e5%92%8c%e6%8c%87%e9%92%88/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 03:12:24 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2009/06/24/c-primer-reading%e5%8a%a8%e6%80%81%e5%86%85%e5%ad%98%e5%88%86%e9%85%8d%e5%92%8c%e6%8c%87%e9%92%88/</guid>
		<description><![CDATA[在C++中对象可以： 静态分配——即编译器在处理程序源代码时分配。 动态分配——即程序执行时调用运行时刻库函数来分配。 这两种内存分配方法的主要区别是：效率与灵活性之间的平衡准则不同。 出于静态内存分配是：在程序执行之前进行的因而效率比较高，但是它缺少灵活性，它要求在程序执行之前就知道所需内存的类型和数量，例如利用静态分配的字符串数组我们无法很容易地处理和存储任意的文本文件，一般来说存储未知数目的元素需要动态内存分配的灵活性。 静态与动态内存分配的两个主要区别是： 静态对象是有名字的变量，我们直接对其进行操作，而动态对象是没有名字的变量，我们通过指针间接地对它进行操作。 静态对象的分配与释放由编译器自动处理，程序员需要理解这一点，但不需要做任何事情相反动态对象的分配与释放，必须由程序员显式地管理相对来说比较容易出错，它通过new 和delete 两个表达式来完成。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=135&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>在C++中对象可以：</p>
<ul>
<li>静态分配——即编译器在处理程序源代码时分配。</li>
<li>动态分配——即程序执行时调用运行时刻库函数来分配。</li>
</ul>
<p>这两种内存分配方法的主要区别是：效率与灵活性之间的平衡准则不同。</p>
<p>出于静态内存分配是：在程序执行之前进行的因而效率比较高，但是它缺少灵活性，它要求在程序执行之前就知道所需内存的类型和数量，例如利用静态分配的字符串数组我们无法很容易地处理和存储任意的文本文件，一般来说存储未知数目的元素需要动态内存分配的灵活性。</p>
<p>静态与动态内存分配的两个主要区别是：</p>
<ol>
<li>静态对象是有名字的变量，我们直接对其进行操作，而动态对象是没有名字的变量，我们通过指针间接地对它进行操作。</li>
<li>静态对象的分配与释放由编译器自动处理，程序员需要理解这一点，但不需要做任何事情相反动态对象的分配与释放，必须由程序员显式地管理相对来说比较容易出错，它通过new 和delete 两个表达式来完成。</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=135&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2009/06/24/c-primer-reading%e5%8a%a8%e6%80%81%e5%86%85%e5%ad%98%e5%88%86%e9%85%8d%e5%92%8c%e6%8c%87%e9%92%88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
		<item>
		<title>SDET 面试技巧</title>
		<link>http://liangdev.wordpress.com/2009/06/04/sdet-%e9%9d%a2%e8%af%95%e6%8a%80%e5%b7%a7/</link>
		<comments>http://liangdev.wordpress.com/2009/06/04/sdet-%e9%9d%a2%e8%af%95%e6%8a%80%e5%b7%a7/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 04:13:29 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2009/06/04/sdet-%e9%9d%a2%e8%af%95%e6%8a%80%e5%b7%a7/</guid>
		<description><![CDATA[发现一个不错的英文ppt，翻译成中文，分享给大家<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=131&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>发现一个不错的英文ppt，翻译成中文，分享给大家</p>
<p><a href="http://liangdev.files.wordpress.com/2009/06/image1.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://liangdev.files.wordpress.com/2009/06/image_thumb1.png?w=402&#038;h=572" width="402" height="572" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=131&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2009/06/04/sdet-%e9%9d%a2%e8%af%95%e6%8a%80%e5%b7%a7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>

		<media:content url="http://liangdev.files.wordpress.com/2009/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>[Tools]Log Parser 分析 IIS log</title>
		<link>http://liangdev.wordpress.com/2009/04/27/toolslog-parser-%e5%88%86%e6%9e%90-iis-log/</link>
		<comments>http://liangdev.wordpress.com/2009/04/27/toolslog-parser-%e5%88%86%e6%9e%90-iis-log/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 09:33:16 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2009/04/27/toolslog-parser-%e5%88%86%e6%9e%90-iis-log/</guid>
		<description><![CDATA[Microsoft Logparser，用来分析log的工具，使用SQL语法的查询接口，基本上我常用的只有IIS log，而且从下图来看，可以导出很多类型的数据形式，挺实用的. Log parser arch 下载地址 : http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&#38;displaylang=en reference Microsoft LogParser : http://www.codinghorror.com/blog/archives/000369.html Log Parser Forum : http://forums.iis.net/default.aspx?GroupID=51 http://www.securityfocus.com/infocus/1712<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=128&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Microsoft Logparser，用来分析log的工具，使用SQL语法的查询接口，基本上我常用的只有IIS log，而且从下图来看，可以导出很多类型的数据形式，挺实用的.</p>
<p><img border="0" alt="logparser_architecture.gif" src="http://www.codinghorror.com/blog/images/logparser_architecture.gif" width="414" height="429" /></p>
<p><em>Log parser arch</em></p>
<p>下载地址 : <a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en</a></p>
<p> reference</p>
<ul>
<li><a href="http://www.codinghorror.com/blog/archives/000369.html">Microsoft LogParser</a> : <a title="http://www.codinghorror.com/blog/archives/000369.html" href="http://www.codinghorror.com/blog/archives/000369.html">http://www.codinghorror.com/blog/archives/000369.html</a> </li>
<li>Log Parser Forum : <a title="http://forums.iis.net/default.aspx?GroupID=51" href="http://forums.iis.net/default.aspx?GroupID=51">http://forums.iis.net/default.aspx?GroupID=51</a> </li>
<li><a title="http://www.securityfocus.com/infocus/1712" href="http://www.securityfocus.com/infocus/1712">http://www.securityfocus.com/infocus/1712</a> </li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=128&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2009/04/27/toolslog-parser-%e5%88%86%e6%9e%90-iis-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>

		<media:content url="http://www.codinghorror.com/blog/images/logparser_architecture.gif" medium="image">
			<media:title type="html">logparser_architecture.gif</media:title>
		</media:content>
	</item>
		<item>
		<title>Stress test via VSTS</title>
		<link>http://liangdev.wordpress.com/2009/03/17/stress-test-via-vsts/</link>
		<comments>http://liangdev.wordpress.com/2009/03/17/stress-test-via-vsts/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 08:29:53 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2009/03/17/stress-test-via-vsts/</guid>
		<description><![CDATA[以前，不知道性能测试(Performance test)，压力测试(Stress test)区别和概念。最近闲来无事，就摊了一个压力测试活儿，业务很简单，主要是理解压力怎么测，测什么，有什么用，什么时候用，怎么用。出个报告，做个PPT。 首先说下压力测试的工具，有Load Runner，VSTS，我现在只能用VSTS，所以就VSTS的相关技术来说。 先说一下参考资料，关于VSTS测试方面的内容，在MSDN上面已经有详细的介绍了（中文的哦）。 LINK:http://msdn.microsoft.com/zh-cn/library/ms182409(VS.80).aspx 还有Ed Glas的blog，总结了一些VSTS Load Test的相关资料 LINK:http://blogs.msdn.com/edglas/pages/content-index-for-web-tests-and-load-tests.aspx 以上资源基本上能够涵盖VSTS Load Test所有概念和方法。 Why Stress Test 测试，我的理解，就是把产品在真实环境里面需要面临的一些场景情况事先模拟一遍，然后心里有了底之后，就敢拿出去忽悠吹嘘了。当然，最基本的就是手工测试。 同样，压力测试也是模拟实际场景来进行测试的，一个服务器，可能在早上8点有100个并发，慢慢就会人多起来，然后到中午12点会有一个高峰，持续到1点，然后下午三点和晚上7点多又迎来一个高峰。这都是基于用户的行为分析来确定场景的。 比如说银行系统，在中午12点的时候，并发有200个请求来访问在线银行，到1点期间差不多都保持在200多个请求并发的水平，对服务器的要求就很高，不能让Server在这一个小时崩掉了。所以要事先模拟一下，以防在真实环境中出乱子，搞得很被动。 压力测试需要明确它的概念，压力测试的目标要让系统能够在固定的时间内，承受起一定的压力并且运行良好，时间是有限的，一般几个小时就差不多能观察出系统压力承受能力了，不需要压个几天几夜的。要运行良好，就是运行的过程中不能有错误。 VSTS可以模拟在这1个小时内200个并发用户的情景。 …<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=127&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>以前，不知道性能测试(Performance test)，压力测试(Stress test)区别和概念。最近闲来无事，就摊了一个压力测试活儿，业务很简单，主要是理解压力怎么测，测什么，有什么用，什么时候用，怎么用。出个报告，做个PPT。</p>
<p>首先说下压力测试的工具，有Load Runner，VSTS，我现在只能用VSTS，所以就VSTS的相关技术来说。</p>
<p>先说一下参考资料，关于VSTS测试方面的内容，在MSDN上面已经有详细的介绍了（中文的哦）。    <br />LINK:<a title="http://msdn.microsoft.com/zh-cn/library/ms182409(VS.80).aspx" href="http://msdn.microsoft.com/zh-cn/library/ms182409(VS.80).aspx">http://msdn.microsoft.com/zh-cn/library/ms182409(VS.80).aspx</a>     <br />还有Ed Glas的blog，总结了一些VSTS Load Test的相关资料     <br />LINK:<a title="http://blogs.msdn.com/edglas/pages/content-index-for-web-tests-and-load-tests.aspx" href="http://blogs.msdn.com/edglas/pages/content-index-for-web-tests-and-load-tests.aspx">http://blogs.msdn.com/edglas/pages/content-index-for-web-tests-and-load-tests.aspx</a></p>
<p>以上资源基本上能够涵盖VSTS Load Test所有概念和方法。</p>
<h6></h6>
<h5>Why Stress Test</h5>
<p>测试，我的理解，就是把产品在真实环境里面需要面临的一些场景情况事先模拟一遍，然后心里有了底之后，就敢拿出去忽悠吹嘘了。当然，最基本的就是手工测试。</p>
<p>同样，压力测试也是模拟实际场景来进行测试的，一个服务器，可能在早上8点有100个并发，慢慢就会人多起来，然后到中午12点会有一个高峰，持续到1点，然后下午三点和晚上7点多又迎来一个高峰。这都是基于用户的行为分析来确定场景的。</p>
<p>比如说银行系统，在中午12点的时候，并发有200个请求来访问在线银行，到1点期间差不多都保持在200多个请求并发的水平，对服务器的要求就很高，不能让Server在这一个小时崩掉了。所以要事先模拟一下，以防在真实环境中出乱子，搞得很被动。</p>
<p>压力测试需要明确它的概念，压力测试的目标要让系统能够在固定的时间内，承受起一定的压力并且运行良好，时间是有限的，一般几个小时就差不多能观察出系统压力承受能力了，不需要压个几天几夜的。要运行良好，就是运行的过程中不能有错误。</p>
<p>VSTS可以模拟在这1个小时内200个并发用户的情景。</p>
<p>…</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=127&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2009/03/17/stress-test-via-vsts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
		<item>
		<title>LiangLib Project</title>
		<link>http://liangdev.wordpress.com/2008/10/30/lianglib-project/</link>
		<comments>http://liangdev.wordpress.com/2008/10/30/lianglib-project/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 06:40:26 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2008/10/30/lianglib-project/</guid>
		<description><![CDATA[Overview LiangLib我平时使用.net工作编程的时候常用的功能，把他们收集起来封装在LiangLib里面，以后用到可以经常拿出来参考。LiangLib是基于.net平台无限递归的开发的库，我会不断的加入新的功能，新的用法，然后让它能够适用于更多的项目，更多的的地方。 Feature List Common Regex Function (正则表达式常用的方法) &#124; under construction Configuration Manage (配置文件管理) &#124; under construction ini file configuration,include write,read and delete specified Section/key/value&#160; (ini 配置文件的读写) &#124; done xml file configuration &#124; under construction Multiple Thread/Thread Pool Manage：多线程和线程池的管理 &#124; under construction Log Helper：记录Log的组件 &#124; under construction Algorithm：常用到的数据结构 &#124; under construction Web Handler Wrapper：常用到的web程序，如：http handler，socket [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=123&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><u>Overview</u></strong></p>
<p>LiangLib我平时使用.net工作编程的时候常用的功能，把他们收集起来封装在LiangLib里面，以后用到可以经常拿出来参考。LiangLib是基于.net平台无限递归的开发的库，我会不断的加入新的功能，新的用法，然后让它能够适用于更多的项目，更多的的地方。</p>
<p><strong><u>Feature List</u></strong></p>
<ul>
<li>Common Regex Function (正则表达式常用的方法) | <strong><font color="#ff0000">under construction</font></strong></li>
<li>Configuration Manage (配置文件管理) | under construction </li>
<ul>
<li>ini file configuration,include write,read and delete specified Section/key/value&#160; (ini 配置文件的读写) | <font color="#008000"><strong>done</strong></font> </li>
<li>xml file configuration | <strong><font color="#ff0000">under construction</font></strong></li>
</ul>
<li>Multiple Thread/Thread Pool Manage：多线程和线程池的管理 | <strong><font color="#ff0000">under construction</font></strong> </li>
<li>Log Helper：记录Log的组件 | <font color="#ff0000"><strong>under construction</strong></font> </li>
<li>Algorithm：常用到的数据结构 | <font color="#ff0000"><strong>under construction</strong></font> </li>
<li>Web Handler Wrapper：常用到的web程序，如：http handler，socket | <font color="#ff0000"><strong>under construction</strong></font></li>
</ul>
<p>【<font color="#ff0000"><strong>under construction</strong></font> (进行中 ),<font color="#008000"><strong>done</strong></font> (已完成)】</p>
<p><strong><u>Develop</u></strong></p>
<p>Manage（进度管理）：<a href="http://hualiang.projects.zoho.com" target="_blank"><strong>zoho project</strong></a></p>
<p>Source Code Host：<a href="http://code.google.com/p/lianglib/" target="_blank"><strong>Google Code</strong></a></p>
<p><strong><u>Reference</u></strong></p>
<ul>
<li><em>cnblogs.com</em> </li>
<li><em>codeproject.com </em></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=123&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2008/10/30/lianglib-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
		<item>
		<title>[LVCFCP] A Prelude to Pointers</title>
		<link>http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-prelude-to-pointers/</link>
		<comments>http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-prelude-to-pointers/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 09:20:37 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-prelude-to-pointers/</guid>
		<description><![CDATA[引用原文地址：http://www.codeproject.com/KB/cpp/pointerprelude.aspx quick notes： 术语： Value &#8211; The actual value of the specified data type. Pointer To &#8211; A pointer to the memory location of a specified data type. Address Of &#8211; The physical memory address of a given data type. Reference To &#8211; A reference to a given data type, NOT a copy of it. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=118&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>引用原文地址：<a title="http://www.codeproject.com/KB/cpp/pointerprelude.aspx" href="http://www.codeproject.com/KB/cpp/pointerprelude.aspx">http://www.codeproject.com/KB/cpp/pointerprelude.aspx</a></p>
<p>quick notes：</p>
<ul>
<li>术语：
<ul>
<li><b>Value</b> &#8211; The actual value of the specified data type. </li>
<li><b>Pointer To</b> &#8211; A pointer to the memory location of a specified data type. </li>
<li><b>Address Of</b> &#8211; The physical memory address of a given data type. </li>
<li><b>Reference To</b> &#8211; A reference to a given data type, NOT a copy of it. (C++ only) </li>
<li><b>Dereferenced Value</b> &#8211; The value of the data type pointed to by a pointer. </li>
</ul>
</li>
<li>看这段代码怎么用引用和指针的：      <br /> 
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// Initialize a variable, 'x', of type 'int' to the 'value' 5.</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> x = 5;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// Initialize a variable, 'px' of type 'pointer to int' to the value of </span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// 'the address of' x.</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span>* px = &amp;x;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    ----      --
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    |         |
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    |         |- This is read &quot;<span style="color:#8b0000;">address of</span>&quot; x
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    |
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    |- Notice I put the * modifier after <span style="color:#0000ff;">int</span>, <span style="color:#0000ff;">not</span> before px (<span style="color:#0000ff;">int</span>* px <span style="color:#0000ff;">not</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">       <span style="color:#0000ff;">int</span> *px).  The compiler doesn't care, however I am modifying the
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">       data type, <span style="color:#0000ff;">not</span> the variable. Thus I remain consistent to my technique.
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// Now initialize a variable 'ref_to_x' as a reference to x.</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span>&amp; ref_to_x = x;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    ----
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    |
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    |- Again, I keep the modifier with what I am modifying.
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// Initialize a variable,'deref_px' of type 'int' to the 'dereferenced </span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// value' of px.</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> deref_px = *px;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">                   ---
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">                   |
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">                   |- Notice in <span style="color:#0000ff;">this</span> <span style="color:#0000ff;">case</span>, the * is with px, because that is
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">                      what I'm modifying.
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
</pre>
</li>
<li>指针的指针<br />
    </p>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span>   x   = 7;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span>*  px  = &amp;x;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span>** ppx = &amp;px;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    printf(&quot;<span style="color:#8b0000;">\nx     = %d</span>&quot;, x    );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    printf(&quot;<span style="color:#8b0000;">\n*px   = %d</span>&quot;, *px  );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    printf(&quot;<span style="color:#8b0000;">\n**ppx = %d</span>&quot;, **ppx);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
</pre>
<pre>结果是：7 7 7</pre>
</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=118&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-prelude-to-pointers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
		<item>
		<title>[LVCFCP] A Beginner&#8217;s Guide to Pointers</title>
		<link>http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-beginners-guide-to-pointers/</link>
		<comments>http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-beginners-guide-to-pointers/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 08:41:04 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-beginners-guide-to-pointers/</guid>
		<description><![CDATA[原文引用地址：http://www.codeproject.com/KB/cpp/pointers.aspx quick notes： 看看这个陷阱 #include &#60;stdio.h&#62; int *pPointer; void SomeFunction(); { int nNumber; nNumber = 25; // make pPointer point to nNumber: pPointer = &#38;nNumber; } void main() { SomeFunction(); // make pPointer point to something // why does this fail? printf("Value of *pPointer: %d\n", *pPointer); } 看出什么错儿了吗？nNmber是局部变量，在SomeFunction之后就销毁了，pPointer就不会指向值25的nNumber了，不知道指哪儿去了 动态分配 #include &#60;stdio.h&#62; int *pPointer; void SomeFunction() [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=116&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>原文引用地址：<a title="http://www.codeproject.com/KB/cpp/pointers.aspx" href="http://www.codeproject.com/KB/cpp/pointers.aspx">http://www.codeproject.com/KB/cpp/pointers.aspx</a></p>
<p>quick notes：</p>
<ul>
<li>看看这个陷阱</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">#include &lt;stdio.h&gt;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> *pPointer;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> SomeFunction();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> nNumber;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    nNumber = 25;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// make pPointer point to nNumber:</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    pPointer = &amp;nNumber;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> main()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    SomeFunction(); <span style="color:#008000;">// make pPointer point to something</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// why does this fail?</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    printf("<span style="color:#8b0000;">Value of *pPointer: %d\n</span>", *pPointer);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<pre>看出什么错儿了吗？nNmber是局部变量，在SomeFunction之后就销毁了，pPointer就不会指向值25的nNumber了，不知道指哪儿去了</pre>
<li>动态分配</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">#include &lt;stdio.h&gt;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> *pPointer;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> SomeFunction()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// 让pPointer指向一个新的int类型内存</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    pPointer = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">int</span>;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    *pPointer = 25;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> main()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    SomeFunction(); <span style="color:#008000;">// 让pPoiner指向某个地方</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    printf("<span style="color:#8b0000;">Value of *pPointer: %d\n</span>", *pPointer);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
<p>这个程序仍有问题。需要加上一行 </pre>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">delete</span> pPointer;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<p>因为，如果不删除这个指针，这块内存不会释放，会产生内存泄露。内存会慢慢泄露，知道程序关闭。</pre>
<li>函数里面传递指针，看两段程序：</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">#include &lt;stdio.h&gt;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> AddFive(<span style="color:#0000ff;">int</span> Number)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    Number = Number + 5;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> main()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> nMyNumber = 18;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    printf("<span style="color:#8b0000;">My original number is %d\n</span>", nMyNumber);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    AddFive(nMyNumber);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    printf("<span style="color:#8b0000;">My new number is %d\n</span>", nMyNumber);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">======================================
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">#include &lt;stdio.h&gt;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> AddFive(<span style="color:#0000ff;">int</span>* Number)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    *Number = *Number + 5;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> main()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> nMyNumber = 18;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    printf("<span style="color:#8b0000;">My original number is %d\n</span>", nMyNumber);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    AddFive(&amp;nMyNumber);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    printf("<span style="color:#8b0000;">My new number is %d\n</span>", nMyNumber);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">=====================================</pre>
</pre>
<pre>第一个程序中,nMyNumber指不会改变，因为AddFive里面处理的是一个拷贝，第二个里面nMyNumber值会改变</pre>
<li>类的指针：</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">class</span> MyClass
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">public</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> m_Number;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">char</span> m_Character;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">};
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> main()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    MyClass *pPointer;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    pPointer = <span style="color:#0000ff;">new</span> MyClass;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    pPointer-&gt;m_Number = 10;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    pPointer-&gt;m_Character = 's';
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">delete</span> pPointer;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<li>指向数组的指针</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">#include &lt;stdio.h&gt;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> main()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> Array[3];
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    Array[0] = 10;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    Array[1] = 20;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    Array[2] = 30;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> *pArray;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    pArray = &amp;Array[0];
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    printf("<span style="color:#8b0000;">pArray points to the value %d\n</span>", *pArray);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<li>一个细节</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> main()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> number;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> *pNumber = number;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">delete</span> pNumber; <span style="color:#008000;">// 错 - *pNumber 没有使用new来分配内存</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<li>引用，看看下面两段程序：</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span>&amp; Number = myOtherNumber;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">Number = 25;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">-----------
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span>* pNumber = &amp;myOtherNumber;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">*pNumber = 25;</pre>
</pre>
<pre>这两段程序是一样的，Number是MyOtherNumber内存地址的引用，Number改变，MyOtherNumber也改变，pNumber又指向myOtherNumber内存，*pNumber赋值25，myOtherNumber值也是25</pre>
<li>SUMMARY</li>
<ol>
<li>Pointers are variables that point to an area in memory. You define a pointer by adding an asterisk (<code>*</code>) in front of the variable name (i.e. <code>int *number</code>).
<li>You can get the address of any variable by adding an ampersand (<code>&amp;</code>) in front of it, i.e. <code>pNumber = &amp;my_number</code>.
<li>The asterisk, unless in a declaration (such as <code>int *number</code>), should be read as &#8220;the memory location pointed to by.&#8221;
<li>The ampersand, unless in a declaration (such as <code>int &amp;number</code>), should be read as &#8220;the address of.&#8221;
<li>You can allocate memory using the <code>new</code> keyword.
<li>Pointers MUST be of the same type as the variables you want them to point to; so, <code>int *number</code> will not point to a <code>MyClass</code>.
<li>You can pass pointers to functions.
<li>You must delete memory that you have allocated by using the <code>delete</code> keyword.
<li>You can get a pointer to an array that already exists by using <code>&amp;array[0];</code>.
<li>You must delete an array that is dynamically allocated using <code>delete[]</code>, not just <code>delete</code>.</li>
</ol>
<li>看看指针和引用的区别：</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> myFirstNumber = 25;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> mySecondNumber = 20;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> &amp;myReference = myFirstNumber;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">myReference = mySecondNumber;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">printf("<span style="color:#8b0000;">%d</span>", myFristNumber);</pre>
</pre>
<pre>输出结果是：20。也就是不能改变一个定义好的引用对象。不能吧myReference改变到mySecondNumber的引用上。在一个类里，引用的值应该这样设置</pre>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">CMyClass::CMyClass(<span style="color:#0000ff;">int</span> &amp;variable) : m_MyReferenceInCMyClass(variable)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// constructor code here</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<pre>是吧？</pre>
<pre>&nbsp;</pre>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=116&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-beginners-guide-to-pointers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
		<item>
		<title>[LVCFCP] The three major concepts of C++ &#8211; Part 1: Classes</title>
		<link>http://liangdev.wordpress.com/2008/10/29/lvcfcp-the-three-major-concepts-of-c-part-1-classes/</link>
		<comments>http://liangdev.wordpress.com/2008/10/29/lvcfcp-the-three-major-concepts-of-c-part-1-classes/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 08:03:27 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2008/10/29/lvcfcp-the-three-major-concepts-of-c-part-1-classes/</guid>
		<description><![CDATA[原文章引用地址：http://www.codeproject.com/KB/cpp/beginnerclass.aspx quick notes: 跟Java和C#的类概念一样，需要注意的，接口写在.h文件里，实现写在.cpp里，类里用private: public:来组织和定义变量和函数方法，属性和方法都可以用”.”来调用操作，指针用“-&#62;”来操作属性和方法。 构造函数和析构函数 构造函数用的比较多了，就不多讲了，他也没讲出什么，详细讲讲析构函数吧： 析构函数在程序的末尾，用来销毁对象用的，如果没有写，就给一个默认的。 内联和外联函数，看起来就像是在类体外面来定义函数 const int SIZE = 40; class employee { private: char name[SIZE]; public: employee() //constructor { strncpy(name, &#34;Unemployed&#34;, SIZE); } ~employee() //destructor { } void set_name(char[SIZE]); //function declarations only void display_name(void); }; // the :: is the scope resolution operator void employee::set_name(char arg_name[SIZE]) { strncpy(name, arg_name, SIZE); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=115&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>原文章引用地址：<a title="http://www.codeproject.com/KB/cpp/beginnerclass.aspx" href="http://www.codeproject.com/KB/cpp/beginnerclass.aspx">http://www.codeproject.com/KB/cpp/beginnerclass.aspx</a></p>
<p>quick notes:</p>
<ul>
<li>跟Java和C#的类概念一样，需要注意的，接口写在.h文件里，实现写在.cpp里，类里用private: public:来组织和定义变量和函数方法，属性和方法都可以用”.”来调用操作，指针用“-&gt;”来操作属性和方法。</li>
<li>构造函数和析构函数     <br />构造函数用的比较多了，就不多讲了，他也没讲出什么，详细讲讲析构函数吧：      <br />析构函数在程序的末尾，用来销毁对象用的，如果没有写，就给一个默认的。</li>
<li>内联和外联函数，看起来就像是在类体外面来定义函数     </li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">const</span> <span style="color:#0000ff;">int</span> SIZE = 40;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">class</span> employee
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">private</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">char</span> name[SIZE];
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">public</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    employee() <span style="color:#008000;">//constructor</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        strncpy(name, &quot;<span style="color:#8b0000;">Unemployed</span>&quot;, SIZE);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    ~employee() <span style="color:#008000;">//destructor</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">void</span> set_name(<span style="color:#0000ff;">char</span>[SIZE]); <span style="color:#008000;">//function declarations only</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">void</span> display_name(<span style="color:#0000ff;">void</span>);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">};
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"><span style="color:#008000;">// the :: is the scope resolution operator</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> employee::set_name(<span style="color:#0000ff;">char</span> arg_name[SIZE])
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    strncpy(name, arg_name, SIZE);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">void</span> employee::display_name(<span style="color:#0000ff;">void</span>)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    cout &lt;&lt; name;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">}</pre>
</pre>
<li>访问控制符使用的技巧：<br />
    </li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">When to use <span style="color:#0000ff;">private</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">//防止发生类以外的改变</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">When to use <span style="color:#0000ff;">protected</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">//私有变量用在继承和组合里面的时候</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">When to use <span style="color:#0000ff;">public</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">//一般的成员变量</span></pre>
</pre>
</ul>
<ul></ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=115&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2008/10/29/lvcfcp-the-three-major-concepts-of-c-part-1-classes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
		<item>
		<title>[LVCFCP] Why I Chose C++</title>
		<link>http://liangdev.wordpress.com/2008/10/29/lvcfcp-why-i-chose-c/</link>
		<comments>http://liangdev.wordpress.com/2008/10/29/lvcfcp-why-i-chose-c/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 02:16:13 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2008/10/29/lvcfcp-why-i-chose-c/</guid>
		<description><![CDATA[引用原文地址：http://www.codeproject.com/KB/cpp/whycplusplus.aspx （仅作学习参考用） quick notes： 操作符重载（Operator Overloading） class CVeryLong { public: // 默认构造器，初始化成员变量为0 CVeryLong(){ m_lHigh = m_lLow = 0; } // 构造器，初始化成员变量值 CVeryLong( long lHigh, long lLow ){ m_lHigh = lHigh; m_lLow = lLow; } virtual ~CVeryLong(){}; // 析构 void SetHighValue( long lValue ){ m_lHigh = lValue; } long GetHighValue(){ return m_lHigh; } void SetLowValue( long [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=110&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>引用原文地址：<a title="http://www.codeproject.com/KB/cpp/whycplusplus.aspx" href="http://www.codeproject.com/KB/cpp/whycplusplus.aspx">http://www.codeproject.com/KB/cpp/whycplusplus.aspx</a> （仅作学习参考用）</p>
<p>quick notes：</p>
<ul>
<li>操作符重载（Operator Overloading）
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">class</span> CVeryLong
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">  {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">  <span style="color:#0000ff;">public</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#008000;">// 默认构造器，初始化成员变量为0</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      CVeryLong(){ m_lHigh = m_lLow = 0; }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#008000;">// 构造器，初始化成员变量值</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      CVeryLong( <span style="color:#0000ff;">long</span> lHigh, <span style="color:#0000ff;">long</span> lLow ){ m_lHigh = lHigh; m_lLow = lLow; }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#0000ff;">virtual</span> ~CVeryLong(){}; <span style="color:#008000;">// 析构</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#0000ff;">void</span> SetHighValue( <span style="color:#0000ff;">long</span> lValue ){ m_lHigh = lValue; }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#0000ff;">long</span> GetHighValue(){ <span style="color:#0000ff;">return</span> m_lHigh; }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#0000ff;">void</span> SetLowValue( <span style="color:#0000ff;">long</span> lValue ){ m_lLow = lValue; }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#0000ff;">long</span> GetLowValue(){ <span style="color:#0000ff;">return</span> m_lLow; }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      BOOL <span style="color:#0000ff;">operator</span> &lt; ( CVeryLong&amp; refValue )    <span style="color:#008000;">// 少于 操作符</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">if</span> ( m_lHigh &lt; refValue.GetHighValue()) <span style="color:#0000ff;">return</span> TRUE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">if</span> ( m_lHigh &gt; refValue.GetHighValue()) <span style="color:#0000ff;">return</span> FALSE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">if</span> ( m_lLow &lt; refValue.GetLowValue()) <span style="color:#0000ff;">return</span> TRUE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">return</span> FALSE; <span style="color:#008000;">// &gt;=</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      BOOL <span style="color:#0000ff;">operator</span> &gt; ( CVeryLong&amp; refValue )    <span style="color:#008000;">// 大于 操作副</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">if</span> ( m_lHigh &gt; refValue.GetHighValue()) <span style="color:#0000ff;">return</span> TRUE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">if</span> ( m_lHigh &lt; refValue.GetHighValue()) <span style="color:#0000ff;">return</span> FALSE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">if</span> ( m_lLow &gt; refValue.GetLowValue()) <span style="color:#0000ff;">return</span> TRUE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">return</span> FALSE; <span style="color:#008000;">// &lt;=</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      BOOL <span style="color:#0000ff;">operator</span> == ( CVeryLong&amp; refValue ) <span style="color:#008000;">// 等于 操作符</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">          <span style="color:#0000ff;">return</span> m_lHigh == refValue.GetHighValue()
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">                   &amp;&amp; m_lLow == refValue.GetLowValue();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">  <span style="color:#0000ff;">private</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#0000ff;">long</span> m_lLow;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">      <span style="color:#0000ff;">long</span> m_lHigh;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">  };</pre>
</pre>
<pre>&nbsp;</pre>
<pre><code>CVeryLong 有两个long类型的成员变量来表示一个单独的64位int类型数据，这个类对&lt;，&gt;，=操作符进行重载实现64位int类的方法，但是这个类还有其他的方法没有实现。上面类的而实现：</code></pre>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   CString csText;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   CVeryLong vl1( 1, 2 ), vl2( 1, 3 ), vl3;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; "<span style="color:#8b0000;">vl1 is (1, 2)</span>" &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; "<span style="color:#8b0000;">vl2 is (1, 3)</span>" &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; "<span style="color:#8b0000;">vl3 is (1, 2)</span>" &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText = "<span style="color:#8b0000;">vl1 &lt; vl2 is </span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText += vl1 &lt; vl2 ? "<span style="color:#8b0000;">true</span>" : "<span style="color:#8b0000;">false</span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; (LPCTSTR)csText &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText = "<span style="color:#8b0000;">vl1 &gt; vl2 is </span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText += vl1 &gt; vl2 ? "<span style="color:#8b0000;">true</span>" : "<span style="color:#8b0000;">false</span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; (LPCTSTR)csText &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText = "<span style="color:#8b0000;">vl1 = = vl2 is </span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText += vl1 == vl2 ? "<span style="color:#8b0000;">true</span>" : "<span style="color:#8b0000;">false</span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; (LPCTSTR)csText &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText = "<span style="color:#8b0000;">vl1 &lt; vl3 is </span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText += vl1 &lt; vl3 ? "<span style="color:#8b0000;">true</span>" : "<span style="color:#8b0000;">false</span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; (LPCTSTR)csText &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText = "<span style="color:#8b0000;">vl1 &gt; vl3 is </span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText += vl1 &gt; vl3 ? "<span style="color:#8b0000;">true</span>" : "<span style="color:#8b0000;">false</span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; (LPCTSTR)csText &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText = "<span style="color:#8b0000;">vl1 = = vl3 is </span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   csText += vl1 == vl3 ? "<span style="color:#8b0000;">true</span>" : "<span style="color:#8b0000;">false</span>";
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   cout &lt;&lt; (LPCTSTR)csText &lt;&lt; endl;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<pre>运行结果：</pre>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl1 is (1, 2)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl2 is (1, 3)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl3 is (1, 2)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl1 &lt; vl2 is <span style="color:#0000ff;">true</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl1 &gt; vl2 is <span style="color:#0000ff;">false</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl1 == vl2 is <span style="color:#0000ff;">false</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl1 &lt; vl3 is <span style="color:#0000ff;">false</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl1 &gt; vl3 is <span style="color:#0000ff;">false</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">       vl1 == vl3 is <span style="color:#0000ff;">true</span></pre>
</pre>
<li>默认的赋值操作将会拷贝成员变量，跟以前一样，只是偶尔（only now）有两个指针指向同一块儿分配内存，当第一块个指针析构第一对象，他将会正确的释放内存。当第二块内存对象的析构器运行的时候，释放这块内存就会产生：BUG和CRASH（崩溃）。<br />等号（=）的重载可以这样写：</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">CVeryVeryLong <span style="color:#0000ff;">operator</span> = ( CVeryVeryLong&amp; refValue ) <span style="color:#008000;">// 赋值操作符</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   <span style="color:#0000ff;">delete</span> [] m_pValues; <span style="color:#008000;">// 释放之前的值</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   m_nValues = refValue.GetNumberOfValues(); <span style="color:#008000;">// 需要是定义好的</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   m_pValues = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">long</span>[ m_nValues ]; <span style="color:#008000;">// 分配新的值</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   <span style="color:#008000;">// GetBuffer() in the following line needs to be defined</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   <span style="color:#008000;">// copy the array contents</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   memcpy( m_pValue, refValue.GetBuffer(), <span style="color:#0000ff;">sizeof</span>(<span style="color:#0000ff;">long</span>) * m_nValues );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">   <span style="color:#0000ff;">return</span> *<span style="color:#0000ff;">this</span>;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<li>异常的处理：WINDOWS NT提供了一种成熟的能力称为SEH（Structured Exception Handling），<br />看下面的异常处理的代码：</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">DWORD dwStart = ::GetTickCount(); <span style="color:#008000;">// 用于计时，单位毫秒</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">const</span> <span style="color:#0000ff;">int</span> x = 1000000;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">const</span> <span style="color:#0000ff;">int</span> xEnd = -x;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> y = x;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> z;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">while</span> ( y &gt; xEnd )
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">try</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">while</span> ( y &gt; xEnd )
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">            z = x / y--; <span style="color:#008000;">// divide protected by exception</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">catch</span> (...)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        cout &lt;&lt; "<span style="color:#8b0000;">Divide by zero</span>" &lt;&lt; endl; <span style="color:#008000;">// trapped out of inner loop</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        y--; <span style="color:#008000;">// continue via outer loop</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">DWORD dwStop = ::GetTickCount();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">DWORD dwDiff = dwStop - dwStart;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">CString csMessage;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">csMessage.Format( "<span style="color:#8b0000;">mSec = %d</span>", dwDiff );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">cout &lt;&lt; (LPCTSTR)csMessage &lt;&lt; endl;</pre>
</pre>
<pre>&nbsp;</pre>
<pre>运行结果：</pre>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">Divide by zero
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">mSec = 491</pre>
</pre>
<li>模板，可以写出更灵活的程序。</li>
<ul>
<li>
<li>方法模板</li>
<ul>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">template</span> &lt;<span style="color:#0000ff;">class</span> T&gt; T&amp; Max( T&amp; a, T&amp; b )
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">if</span> ( a &gt;  b ) <span style="color:#0000ff;">return</span> a; <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">return</span> b;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">}</pre>
</pre>
<pre>使用：</pre>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">int</span> n1 = 5, n2 = 10, n3;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">float</span> f1 = 5.1f, f2 = 10.5f, f3;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">CVeryLong vl1( 1, 2 ), vl2( 2, 15 ), vl3; <span style="color:#008000;">// remember CVeryLong?</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">n3 = Max( n1, n2 );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">f3 = Max( f1, f2 );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">vl3 = Max( vl1, vl2 );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">CString csMessage;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">csMessage.Format( "<span style="color:#8b0000;">n3 = %d, f3 = %f, vl3 = (%d, %d)</span>",
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">                  n3, f3, vl3.GetHighValue(), vl3.GetLowValue() );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">cout &lt;&lt; (LPCTSTR)csMessage &lt;&lt; endl;</pre>
</pre>
<pre>&nbsp;</pre>
<pre>结果：</pre>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">n3 = 10, f3 = 10.500000, vl3 = (2, 15)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
</pre>
<pre>STL和ATL都是非常常用的用于创建小程序和高重用性的库。</pre>
</ul>
<li>类模板
</li>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">template</span>&lt;<span style="color:#0000ff;">class</span> KEY, <span style="color:#0000ff;">class</span> ARG_KEY, <span style="color:#0000ff;">class</span> DATA, <span style="color:#0000ff;">class</span> ARG_DATA&gt;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">class</span> CTree
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">private</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">typedef</span> <span style="color:#0000ff;">enum</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    {   balLeft = -1,
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        balEven,
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        balRight,
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    } BALANCE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">class</span> CNode;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">typedef</span> CNode* PNODE;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">class</span> CNode <span style="color:#008000;">// container to hold the data and hide the balancing details</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">public</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        CNode( ARG_KEY key, ARG_DATA data );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        <span style="color:#008000;">// additional members not shown</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">private</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        KEY m_key;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        DATA m_data;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        BALANCE m_Bal; <span style="color:#008000;">// -1..1 current balance data for this node</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        PNODE m_pLeft;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">        PNODE m_pRight;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    };
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    CTree(){ m_pRoot = 0; m_nSize = 0; m_bHeightChange = <span style="color:#0000ff;">false</span>; }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">virtual</span> ~CTree();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">bool</span> GetFirst( ARG_KEY key, ARG_DATA data );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">bool</span> GetLast( ARG_KEY key, ARG_DATA data );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">bool</span> GetNext( ARG_KEY key, ARG_DATA data );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">bool</span> GetPrev( ARG_KEY key, ARG_DATA data );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">bool</span> Add( ARG_KEY key, ARG_DATA data );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    ARG_DATA <span style="color:#0000ff;">operator</span>[]( ARG_KEY key );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">bool</span> Delete( ARG_KEY key );
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// additional members not shown</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"><span style="color:#0000ff;">private</span>:
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    CNode* m_pRoot;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">bool</span> m_bHeightChange;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">int</span> m_nSize;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;">};
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;margin:0;"></pre>
</pre>
</ul>
</ul>
<p>-Still need to develop-</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=110&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2008/10/29/lvcfcp-why-i-chose-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
		<item>
		<title>3 Days to Learn VC from Codeproject -PAUSE</title>
		<link>http://liangdev.wordpress.com/2008/10/28/3-days-to-learn-vc-from-codeproject/</link>
		<comments>http://liangdev.wordpress.com/2008/10/28/3-days-to-learn-vc-from-codeproject/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 09:11:04 +0000</pubDate>
		<dc:creator>liangdev</dc:creator>
				<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://liangdev.wordpress.com/2008/10/28/3-days-to-learn-vc-from-codeproject/</guid>
		<description><![CDATA[Under List of C++ / MFC / STL – Beginners （初学者） { Begin : 29/10/2008  &#124; Expected end : 31/10/2008 } 文章列表： 【Day 1】An introduction to bitwise operators ：介绍位操作，内存细节，C++编程需要掌握的一些基础概念吧。&#124; notes &#124; complete 【Day 1】A Beginner&#8217;s Guide to Pointers ：介绍指针的基础用法，指针是最头疼的东东了，这个得好好看看 &#124; notes &#124; complete 【Day 1】A Prelude to Pointers ：接着上一篇内容来继续介绍指针。&#124; notes &#124; complete 【Day 1】A serialization [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=103&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h5>Under List of <a name="C++ / MFC / STL - Beginners">C++ / MFC / STL – Beginners</a> （初学者）</h5>
<h5>{ <strong>Begin</strong> : 29/10/2008  | Expected <strong>end</strong> : 31/10/2008 }</h5>
<p><strong></strong></p>
<p><strong>文章列表：</strong></p>
<ul>
<li>【Day <strong>1</strong>】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/bitbashing.aspx"><span style="font-size:x-small;font-family:c;">An introduction to bitwise operators</span></a> ：介绍位操作，内存细节，C++编程需要掌握的一些基础概念吧。| <a href="http://liangdev.wordpress.com/2008/10/28/lvcfcp-introduction-to-bitwise-operators/" target="_blank"><strong>notes</strong></a> | <strong>complete</strong></li>
<li>【Day 1】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/pointers.aspx">A Beginner&#8217;s Guide to Pointers</a> ：介绍指针的基础用法，指针是最头疼的东东了，这个得好好看看 | <a href="http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-beginners-guide-to-pointers/" target="_blank"><strong>notes</strong></a> | <strong>complete</strong></li>
<li>【Day 1】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/pointerprelude.aspx">A Prelude to Pointers</a> ：接着上一篇内容来继续介绍指针。| <a href="http://liangdev.wordpress.com/2008/10/29/lvcfcp-a-prelude-to-pointers/" target="_blank"><strong>notes</strong></a> | <strong>complete</strong></li>
<li>【Day 1】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/serialization_primer2.aspx">A serialization primer &#8211; Part 2</a> not begin</li>
<li>【Day 1】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/beginnerclass.aspx">The three major concepts of C++ &#8211; Part 1: Classes</a> ：C++的三个主要的概念，第一部分：类。| <a href="http://liangdev.wordpress.com/2008/10/29/lvcfcp-the-three-major-concepts-of-c-part-1-classes/" target="_blank"><strong>notes</strong></a> | <strong>complete</strong></li>
<li>【Day 1】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/SyncMultithreadedMFC.aspx">Synchronization in Multithreaded Applications with MFC</a> not begin</li>
<li>【Day 1】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/templates_part1.aspx">A Beginners guide to Templates &#8211; Part 1</a> not begin</li>
<li>【Day 2】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/serialization_primer1.aspx">A serialization primer &#8211; Part 1</a> not begin</li>
<li>【Day 2】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/virtual_function.aspx">Think before you code, Virtual Functions in C++</a> not begin</li>
<li>【Day 2】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/Bitwise_Operation.aspx">Bitwise Operation Explained</a>  not begin</li>
<li>【Day <strong>1</strong>】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/whycplusplus.aspx">Why I Chose C++</a> ：为什么要选择C++呢？这里介绍了一些C++的特性。| <strong><a href="http://liangdev.wordpress.com/2008/10/29/lvcfcp-why-i-chose-c/" target="_blank">notes</a></strong> | <strong>complete</strong></li>
<li>【Day 2】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/mfcprogflow.aspx">MFC under the hood</a> not begin</li>
<li>【Day 2】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/serialization_primer3.aspx">A serialization primer &#8211; Part 3</a> not begin</li>
<li>【Day 2】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/Introduce_Yourself_to_VC.aspx">Introduce Yourself to VC++</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/programming_styles.aspx">Different Styles of Programming</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/beginneroop.aspx">A beginner&#8217;s guide to Object Orientation</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/using_namespaces.aspx">Using namespaces properly</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/templates_part2.aspx">A Beginners guide to Templates &#8211; Part 2</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/maxcode.aspx">Template based programming</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/ConstIllustration.aspx">Const illustration in C++</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/MemoryLeakDetectionIn_CPP.aspx">Memory leak detection in C++</a> not begin</li>
<li>【Day 3】<a name="artTitle" href="http://www.codeproject.com/KB/cpp/SimpleQueue.aspx">Learn Queue with some exceptional Handling</a> not begin</li>
</ul>
<p>最近的项目需要用到C++，现学现用吧。</p>
<p>有用的C++学习资源网站：</p>
<ul>
<li><a title="http://www.cplusplus.com/" href="http://www.cplusplus.com/">http://www.cplusplus.com/</a> C++.com，一个基础的C++入门网站，里面也有很多基础的东西。</li>
<li><a title="http://www.learncpp.com/" href="http://www.learncpp.com/">http://www.learncpp.com/</a> </li>
<li><a title="http://newdata.box.sk/bx/c/htm/ch08.htm" href="http://newdata.box.sk/bx/c/htm/ch08.htm">http://newdata.box.sk/bx/c/htm/ch08.htm</a> 21天学会C++，扯淡！</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/liangdev.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/liangdev.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/liangdev.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/liangdev.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/liangdev.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/liangdev.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/liangdev.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/liangdev.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/liangdev.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/liangdev.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/liangdev.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/liangdev.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/liangdev.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/liangdev.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=liangdev.wordpress.com&amp;blog=4936567&amp;post=103&amp;subd=liangdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://liangdev.wordpress.com/2008/10/28/3-days-to-learn-vc-from-codeproject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4f9ee45d2bd1d0a865d9f86e8e74ae19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liangdev</media:title>
		</media:content>
	</item>
	</channel>
</rss>
