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

<channel>
	<title>苏洋博客 &#187; C &amp; C++</title>
	<atom:link href="http://promiseforever.com/topics/learning/c-learning/feed" rel="self" type="application/rss+xml" />
	<link>http://promiseforever.com</link>
	<description>记录我的一点一滴。</description>
	<lastBuildDate>Sun, 05 Feb 2012 22:14:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>一道趣味题</title>
		<link>http://promiseforever.com/2012/01/10/%e4%b8%80%e9%81%93%e8%b6%a3%e5%91%b3%e9%a2%98.html</link>
		<comments>http://promiseforever.com/2012/01/10/%e4%b8%80%e9%81%93%e8%b6%a3%e5%91%b3%e9%a2%98.html#comments</comments>
		<pubDate>Tue, 10 Jan 2012 07:05:42 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[升级]]></category>
		<category><![CDATA[屠龙刀]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=5037</guid>
		<description><![CDATA[刚刚看到了一道题. 一把1级屠龙刀，最高可以升到9级，每次升级成功率30%，失败率70%。失败会退一级，最差退到1级。 那么在1000次内升级到9级的概率为多少？ 尝试写了一个php的模拟,第一次没设定失败下限.结果很给力. 第994次升级结果:屠龙刀等级为:-358! 第995次升级结果:屠龙刀等级为:-359! 第996次升级结果:屠龙刀等级为:-358! 第997次升级结果:屠龙刀等级为:-359! 第998次升级结果:屠龙刀等级为:-360! 第999次升级结果:屠龙刀等级为:-361! 后来运气好了一次. 第342次升级结果:屠龙刀等级为:7!最高等级为7 第343次升级结果:屠龙刀等级为:8!最高等级为8 第344次升级结果:屠龙刀等级为:9!最高等级为9 坑爹九级神器！ 代码如下，群里有个大大的高端代码，我也留下来。 &#60;?php &#160; $Updateresultabby = array&#40; array&#40; 'return' =&#62; -1, 'range' =&#62; '70' &#41;, array&#40; 'return' =&#62; 1, 'range' =&#62; '30' &#41; &#41;; &#160; $level =1 ; $level_max =2; &#160; for&#40; $i = 0; $i &#60; 2000; $i++ &#41;&#123; &#160; ...]]></description>
		<wfw:commentRss>http://promiseforever.com/2012/01/10/%e4%b8%80%e9%81%93%e8%b6%a3%e5%91%b3%e9%a2%98.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[C++]VS2010中C++第一个陷阱</title>
		<link>http://promiseforever.com/2011/10/11/cvs2010%e4%b8%adc%e7%ac%ac%e4%b8%80%e4%b8%aa%e9%99%b7%e9%98%b1.html</link>
		<comments>http://promiseforever.com/2011/10/11/cvs2010%e4%b8%adc%e7%ac%ac%e4%b8%80%e4%b8%aa%e9%99%b7%e9%98%b1.html#comments</comments>
		<pubDate>Tue, 11 Oct 2011 12:17:37 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[isdigit]]></category>
		<category><![CDATA[死循环]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=4612</guid>
		<description><![CDATA[string number1,number2; std::cout&#60;&#60;tip&#91;0&#93;&#60;&#60;&#34;\n&#34;&#60;&#60;tip&#91;1&#93;&#60;&#60;std::endl; std::cin&#62;&#62;number1; &#160; while&#40;!isdigit&#40;number1&#41;&#41;&#123; std::cout&#60;&#60;tip&#91;5&#93;&#60;&#60;std::endl; std::cin&#62;&#62;number1; &#125; &#160; std::cout&#60;&#60;tip&#91;2&#93;&#60;&#60;std::endl 大概就是这个过程吧,会出现神马情况呢,如果cin接受的用户输入不是0~9而是其他呢. 我觉得木有亲手打过的童鞋100%说,循环判断是不是数字,不是就停下来等用户输入下一次. 那么好,扔VS里调试下吧.结果呢,无限循环吧.. 原因 是什么呢.这里很明显嘛,为什么会循环,while嘛,为什么while会死循环,!isdigit(number1)成立.. 所以呢,number1,也就是从cin传递来的用户输入有问题. 有什么问题呢. typeid(number1).name(); 后得到一个反馈..嗯.char类型.. 那么如何解决呢? 我觉得加段小函数检查就可以了.. bool IsNumber&#40;string s&#41;&#123; const char *tmp = s.c_str&#40;&#41;; for&#40;int i =0;i&#60;s.length&#40;&#41;;i++&#41; &#123; if &#40;tmp&#91;i&#93;&#62;57&#124;&#124;tmp&#91;i&#93;&#60;48&#41; return false; &#125; return true; &#125;]]></description>
		<wfw:commentRss>http://promiseforever.com/2011/10/11/cvs2010%e4%b8%adc%e7%ac%ac%e4%b8%80%e4%b8%aa%e9%99%b7%e9%98%b1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[我的总结]关于ROUND函数的BUG</title>
		<link>http://promiseforever.com/2009/07/15/bug-round.html</link>
		<comments>http://promiseforever.com/2009/07/15/bug-round.html#comments</comments>
		<pubDate>Wed, 15 Jul 2009 00:21:29 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[我的总结]]></category>
		<category><![CDATA[BUG]]></category>
		<category><![CDATA[ROUND]]></category>
		<category><![CDATA[函数]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=2055</guid>
		<description><![CDATA[ROUND函数在很多语言中都存在，它的“bug”也威名远播&#8230; 关于它的舍入问题，很多人都总结过吧，四舍六入五成双。 文章包含代码以及一些引用资料，如果感兴趣，可以选择阅读全文。 以下资料来自CSDN 以及黄海blog ROUND函数在很多语言中都存在，它的“bug”也威名远播&#8230; 关于它的舍入问题，很多人都总结过吧，四舍六入五成双。 文章包含代码以及一些引用资料，如果感兴趣，可以选择阅读全文。 以下资料来自CSDN 以及黄海blog 其实财务函数的它主要是进行一种平衡算法。 正如一位朋友所言 ， “VBA中的Round函数不是Bug，而只是一种特殊算法（银行业算法）。 简单地说就是向最近的偶数位舍入。 如：Round(3.375,2)==Round(3.385,2)==3.38” 下面的这个函数（算术四舍五入平衡算法）考虑了负数的处理改编自微软文档，可以用于财务系统开发： Function SARound(ByVal X As Currency, Optional ByVal Factor As Long = 2) As Currency SARound = Fix(X * 10 ^ Factor + Sgn(X) * 0.5) / 10 ^ Factor End Function 如果把Fix变为Int就成为不平衡算法。 MS文档原文： http://support.microsoft.com/default.aspx?scid=kb;en-us;196652 &#160; Public Function RoundToLarger(dblInput ...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/07/15/bug-round.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[C]Hello World 也疯狂</title>
		<link>http://promiseforever.com/2009/06/06/c-crazy-hello-world.html</link>
		<comments>http://promiseforever.com/2009/06/06/c-crazy-hello-world.html#comments</comments>
		<pubDate>Sat, 06 Jun 2009 14:00:43 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[HELLO WORLD]]></category>
		<category><![CDATA[经典]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=1899</guid>
		<description><![CDATA[原文出处：http://www.baiba.net/blog/?action=show&#38;id=61
这篇不收录过来实在是...对不起自己...嘿嘿~
都在Dev-C++里跑了一遍。

[c]
#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;

int main(int argc, char *argv[])
{
int x=0,y[14],*z=&#38;y;
*(z++)=0x48;
*(z++)=y[x++]+0x1D;
*(z++)=y[x++...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/06/06/c-crazy-hello-world.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>[C]基础题练习10道</title>
		<link>http://promiseforever.com/2009/06/05/c-start-1.html</link>
		<comments>http://promiseforever.com/2009/06/05/c-start-1.html#comments</comments>
		<pubDate>Fri, 05 Jun 2009 07:10:05 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[练习题]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=1867</guid>
		<description><![CDATA[看的唯C论坛的电子书了..手痒,把10道题都练下吧。

[c]

/* 题目：有1、2、3、4个数字，能组成多少个互不相同且无重复数字的三位数？都是多少？*/
#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;

int main(int argc, char *argv[])
{
int i,j,k,t;
t=0;
printf(&#34;无重复3位数如下：
&#34;);
for(...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/06/05/c-start-1.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[MFC]消息机制</title>
		<link>http://promiseforever.com/2009/05/16/mfc-message.html</link>
		<comments>http://promiseforever.com/2009/05/16/mfc-message.html#comments</comments>
		<pubDate>Sat, 16 May 2009 07:15:01 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[WIN32]]></category>
		<category><![CDATA[经典资料]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[机制]]></category>
		<category><![CDATA[消息]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=1498</guid>
		<description><![CDATA[MFC剖析：消息机制 出处：白云黄鹤 转载的一篇老文，有的放矢的说明了MFC消息流程。 首先,让我们看一下MFC的消息循环部分：（程序取自MFC源程序，由于篇幅，我删去了一些非重要的部分。） MFC的WinMain函数： extern &#34;C&#34; int WINAPI _tWinMain&#40;HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow&#41; &#123; // call shared/exported WinMain return AfxWinMain&#40;hInstance, hPrevInstance, lpCmdLine, nCmdShow&#41;; &#125; &#160; int AFXAPI AfxWinMain &#40;HINSTANCE hInstance, HINSTANCE hPrevInstance, &#160; LPTSTR lpCmdLine, int nCmdShow&#41; &#123; int nReturnCode = -1; CWinApp* pApp = AfxGetApp&#40;&#41;; &#160; // ...... &#160; // ...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/05/16/mfc-message.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[C++]用 QueryPerformanceFrequency 和 QueryPerformanceCounter 进行高精度计时</title>
		<link>http://promiseforever.com/2009/04/23/c-queryperformancecounter-queryperformancefrequency.html</link>
		<comments>http://promiseforever.com/2009/04/23/c-queryperformancecounter-queryperformancefrequency.html#comments</comments>
		<pubDate>Thu, 23 Apr 2009 02:14:20 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[QueryPerformanceCounter]]></category>
		<category><![CDATA[QueryPerformanceFrequency]]></category>
		<category><![CDATA[高精度计时]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=361</guid>
		<description><![CDATA[[C++]用 QueryPerformanceFrequency 和 QueryPerformanceCounter 进行高精度计时
http://www.cppblog.com/bidepan2023/archive/2008/01/22/41627.html

C++代码

    void&#160;main()&#160;{&#160;&#160;&#160;&#160; &#160;&#160;
    &#160;&#160;&#160;&#160;LARGE_INTEGER&#160;lv; &#160;&#160;
    &#160;&#038;nb...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/04/23/c-queryperformancecounter-queryperformancefrequency.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[C]ifndef#define#endif的用法</title>
		<link>http://promiseforever.com/2009/04/23/c-ifndef-define-endif.html</link>
		<comments>http://promiseforever.com/2009/04/23/c-ifndef-define-endif.html#comments</comments>
		<pubDate>Thu, 23 Apr 2009 01:55:19 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[#define]]></category>
		<category><![CDATA[#endif]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[ifndef]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=362</guid>
		<description><![CDATA[ifndef#define#endif的用法 整理：shichenghua
文件中的#ifndef 
头件的中的#ifndef，这是一个很关键的东西。比如你有两个C文件，这两个C文件都include了同一个头文件。而编译时，这两个C文件要一同编译成一个可运行文件，于是问题来了，大量的声明冲突。 
还是把头文件的内容都放在#ifndef和#endif中吧。不管你的头文件...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/04/23/c-ifndef-define-endif.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[C++]Windows管道技术简述</title>
		<link>http://promiseforever.com/2009/04/23/c-piping.html</link>
		<comments>http://promiseforever.com/2009/04/23/c-piping.html#comments</comments>
		<pubDate>Wed, 22 Apr 2009 23:33:04 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[经典资料]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[WINDOWS]]></category>
		<category><![CDATA[管道技术]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=365</guid>
		<description><![CDATA[Windows管道技术简述
detrox
不知你是否用过这样的程序，他们本身并没有解压缩的功能，而是调用DOS程序PKZIP完成ZIP包的解压缩。但是在程序运行时又没有DOS控制台的窗口出现而且一切本应该在DOS下显示的信息都出现在了那个安装程序的一个文本框里。这种设计既美观又可以防止少数眼疾手快的用户提前关了你的DOS窗口。
现在...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/04/23/c-piping.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[C++]改变其他应用程序的字体的问题</title>
		<link>http://promiseforever.com/2009/04/22/c-change-application-font.html</link>
		<comments>http://promiseforever.com/2009/04/22/c-change-application-font.html#comments</comments>
		<pubDate>Wed, 22 Apr 2009 01:03:32 +0000</pubDate>
		<dc:creator>苏洋</dc:creator>
				<category><![CDATA[C & C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[改变字体]]></category>

		<guid isPermaLink="false">http://promiseforever.com/?p=371</guid>
		<description><![CDATA[CSDN上一篇老文。关于HOOK,提问者应该成为大虾了吧。
原文：http://topic.csdn.net/t/20020508/21/706849.html
改变其他应用程序的控件字体的问题
[高分,再发布]改变其他应用程序的控件字体的问
alexanderyu（alex）2002-05-08 21:56:13 在 VC/MFC / 基础类
我要做一个改变其他进程（其他应用程序）的窗口中控件(BUTTO...]]></description>
		<wfw:commentRss>http://promiseforever.com/2009/04/22/c-change-application-font.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

