﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-像风一般地奔跑</title><link>http://www.cppblog.com/crazywind/</link><description>永远向前，永不放弃</description><language>zh-cn</language><lastBuildDate>Thu, 09 Apr 2026 07:05:52 GMT</lastBuildDate><pubDate>Thu, 09 Apr 2026 07:05:52 GMT</pubDate><ttl>60</ttl><item><title>转： va_start() va_end()函数应用</title><link>http://www.cppblog.com/crazywind/archive/2007/11/22/37151.html</link><dc:creator>风在奔跑</dc:creator><author>风在奔跑</author><pubDate>Thu, 22 Nov 2007 10:28:00 GMT</pubDate><guid>http://www.cppblog.com/crazywind/archive/2007/11/22/37151.html</guid><wfw:comment>http://www.cppblog.com/crazywind/comments/37151.html</wfw:comment><comments>http://www.cppblog.com/crazywind/archive/2007/11/22/37151.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/crazywind/comments/commentRss/37151.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/crazywind/services/trackbacks/37151.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;<a href='http://www.cppblog.com/crazywind/archive/2007/11/22/37151.html'>阅读全文</a><img src ="http://www.cppblog.com/crazywind/aggbug/37151.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/crazywind/" target="_blank">风在奔跑</a> 2007-11-22 18:28 <a href="http://www.cppblog.com/crazywind/archive/2007/11/22/37151.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>再谈学习力</title><link>http://www.cppblog.com/crazywind/archive/2007/09/28/33082.html</link><dc:creator>风在奔跑</dc:creator><author>风在奔跑</author><pubDate>Fri, 28 Sep 2007 03:31:00 GMT</pubDate><guid>http://www.cppblog.com/crazywind/archive/2007/09/28/33082.html</guid><wfw:comment>http://www.cppblog.com/crazywind/comments/33082.html</wfw:comment><comments>http://www.cppblog.com/crazywind/archive/2007/09/28/33082.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/crazywind/comments/commentRss/33082.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/crazywind/services/trackbacks/33082.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 学习力这门本书看完已经几个月咯，当时觉得自己对时间的管理得到了很大的提升，现在发觉有些地方自己做的还是不够好呀。嗯，写下此文，以自勉。<br>&nbsp;&nbsp;<a href='http://www.cppblog.com/crazywind/archive/2007/09/28/33082.html'>阅读全文</a><img src ="http://www.cppblog.com/crazywind/aggbug/33082.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/crazywind/" target="_blank">风在奔跑</a> 2007-09-28 11:31 <a href="http://www.cppblog.com/crazywind/archive/2007/09/28/33082.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC6中友元函数访问权限的问题</title><link>http://www.cppblog.com/crazywind/archive/2007/09/21/32607.html</link><dc:creator>风在奔跑</dc:creator><author>风在奔跑</author><pubDate>Fri, 21 Sep 2007 03:21:00 GMT</pubDate><guid>http://www.cppblog.com/crazywind/archive/2007/09/21/32607.html</guid><wfw:comment>http://www.cppblog.com/crazywind/comments/32607.html</wfw:comment><comments>http://www.cppblog.com/crazywind/archive/2007/09/21/32607.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/crazywind/comments/commentRss/32607.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/crazywind/services/trackbacks/32607.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 今天同学在用VC6写程序时遇到一个问题，就是友元函数不能访问private成员变量。但是我在VS2003中能够完全通过。不知道这个是不是VC6中的一个BUG。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 然而在VC6中，如果对头文件的包含使用#include&lt;iostream.h&gt;.去掉标记名字空间的using namespace std这行代码后，又能够调试通过，且程序运行完全正确<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 因此估计是VC6的对标准C++支持的问题造成的吧。我VC6平时用得很少，一般都用VS2003。
<img src ="http://www.cppblog.com/crazywind/aggbug/32607.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/crazywind/" target="_blank">风在奔跑</a> 2007-09-21 11:21 <a href="http://www.cppblog.com/crazywind/archive/2007/09/21/32607.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>写了一个用来写log信息的小程序</title><link>http://www.cppblog.com/crazywind/archive/2007/09/09/31906.html</link><dc:creator>风在奔跑</dc:creator><author>风在奔跑</author><pubDate>Sun, 09 Sep 2007 13:40:00 GMT</pubDate><guid>http://www.cppblog.com/crazywind/archive/2007/09/09/31906.html</guid><wfw:comment>http://www.cppblog.com/crazywind/comments/31906.html</wfw:comment><comments>http://www.cppblog.com/crazywind/archive/2007/09/09/31906.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cppblog.com/crazywind/comments/commentRss/31906.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/crazywind/services/trackbacks/31906.html</trackback:ping><description><![CDATA[<p>写了个log类。但是越写越觉得不对劲，越写发现越需要扩充。。</p>
<p>最大的问题是发现封装成类后反而别扭- -主要应该还是自己功底不够吧。</p>
<p>&shy;最后用C语言，InitLog(),WriteLog(),CloseLog(). 三个函数搞定。暂且满足程序的需要，虽然CloseLog()这个函数也不是必须地，不过加上能让跟踪出的log信息更完整吧。</p>
<p>第一次来写博客，我是菜鸟，不懈努力的菜鸟。<br></p>
<span id=Code_Open_Text_213306 style="DISPLAY: none"></span>
<p><br>&nbsp;</p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #808080">//////////////////////////////////////////////////////////////////////////////////////////<br></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">wde_log.h</span><span style="COLOR: #008000"><br></span><span style="COLOR: #808080">//////////////////////////////////////////////////////////////////////////////////////////<br></span><span style="COLOR: #000000">#ifndef&nbsp;WDE_LOG_H<br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000">&nbsp;WDE_LOG_H</span><span style="COLOR: #000000"><br>#include&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">windows.h</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br>#include&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">cstdio</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000">&nbsp;std;<br><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000">&nbsp;LOGFILENAME&nbsp;&#8220;log.txt&#8221;</span><span style="COLOR: #000000"><br><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;OpenLog();<br><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;GameLog(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;p_Message,&nbsp;</span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000">&nbsp;p_bNeedTime&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">);<br><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;CloseLog();<br><br></span><span style="COLOR: #0000ff">#endif</span><span style="COLOR: #000000"><br></span><span style="COLOR: #808080">//////////////////////////////////////////////////////////////////////////////////////////<br></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">wde_log.cpp</span><span style="COLOR: #008000"><br></span><span style="COLOR: #808080">//////////////////////////////////////////////////////////////////////////////////////////<br></span><span style="COLOR: #000000">#include&nbsp;&#8220;wde_Log.h&#8221;<br><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;OpenLog()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;FILE&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">logfile;<br>&nbsp;&nbsp;&nbsp;&nbsp;logfile&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;fopen(LOGFILENAME,&nbsp;&#8220;w&#8221;);<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">logfile)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox(NULL,&nbsp;&#8220;无法创建日志文件,程序终止&#8221;,&nbsp;&#8220;ERROR&#8221;,MB_OK);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;fputs(&#8221;打开应用程序日志文件\n&#8221;,logfile);<br>&nbsp;&nbsp;&nbsp;&nbsp;fputs(&#8221;———————————————————————</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">\n&#8221;,logfile);<br>}<br><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;GameLog(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;p_Message,&nbsp;</span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000">&nbsp;p_bNeedTime&nbsp;</span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;=&nbsp;true&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000">)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;FILE&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">writelog;<br>&nbsp;&nbsp;&nbsp;&nbsp;writelog&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;fopen(LOGFILENAME,&nbsp;&#8220;a</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&#8221;);<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">writelog)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox(NULL,&#8221;无法写入日志文件，程序终止&#8221;,&nbsp;&#8220;ERROR&#8221;,&nbsp;MB_OK);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;SYSTEMTIME&nbsp;CurrentTime;<br>&nbsp;&nbsp;&nbsp;&nbsp;GetLocalTime(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">CurrentTime);<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(p_bNeedTime)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fprintf(writelog,&#8221;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">2d</span><span style="COLOR: #000000">/%</span><span style="COLOR: #000000">2d</span><span style="COLOR: #000000">/%</span><span style="COLOR: #000000">4d&nbsp;&#8220;,&nbsp;CurrentTime.wMonth,&nbsp;CurrentTime.wDay,&nbsp;CurrentTime.wYear);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fprintf(writelog,&#8221;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">2d:</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">2d:</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">2d&nbsp;&nbsp;&#8220;,CurrentTime.wHour,&nbsp;CurrentTime.wMinute,&nbsp;CurrentTime.wSecond);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;fputs(p_Message,&nbsp;writelog);<br><br>}<br><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;CloseLog()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;FILE&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">closefile;<br>&nbsp;&nbsp;&nbsp;&nbsp;closefile&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;fopen(LOGFILENAME,&nbsp;&#8220;a</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&#8221;);<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">closefile)<br>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox(NULL,&#8221;无法写入日志文件，程序终止&#8221;,&nbsp;&#8220;ERROR&#8221;,&nbsp;MB_OK);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;fputs(&#8221;———————————————————————</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">\n&#8221;,closefile);<br>&nbsp;&nbsp;&nbsp;&nbsp;fputs(&#8221;关闭应用程序日志文件\n&#8221;,closefile);<br>}<br></span><span style="COLOR: #808080">//////////////////////////////////////////////////////////////////////////////////////////</span></div>
<img src ="http://www.cppblog.com/crazywind/aggbug/31906.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/crazywind/" target="_blank">风在奔跑</a> 2007-09-09 21:40 <a href="http://www.cppblog.com/crazywind/archive/2007/09/09/31906.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>