随笔分类 -  CPP/Tricks

摘要:如果在一个类中声明了纯虚函数,而在其派生类中没有对该函数定义,则该函数在派生类中仍为纯虚函数;如果在派生类中没有对所有的纯虚函数进行定义,则此派生类仍然是抽象类,不能用来定义对象;居然忘记了...该死 阅读全文

posted @ 2009-04-05 13:29 活着就是幸福 阅读(200) 评论(0) 推荐(0) 编辑

摘要:没怎么用STL,有点忘记了. 有一个定义: class A{public: void func() const { m_map[4]; } std::map m_map;};不幸的是编译错误: error C2678: binary '[' : no operator found which takes a left-hand operand of type ... 阅读全文

posted @ 2009-04-04 05:58 活着就是幸福 阅读(938) 评论(0) 推荐(0) 编辑

摘要:很多书有电子版,但是有些经典的书还是要买纸版的,电子书和纸版书的感觉毕竟不一样。 1.【C++ primer 3/4 ed】 不用说了,3或者4必有一本。我更倾向于3,潘爱民翻译,虽然老一些,但是更全。新手看4可能更好些。 2.【Effective C++ 3ed】 也不用说,绝对经典,第三版必有一本,侯杰翻译,教你如何写出高质量的程序。第二版可以保留一本电子书。 ... 阅读全文

posted @ 2008-11-17 23:09 活着就是幸福 阅读(239) 评论(0) 推荐(0) 编辑

摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#undef __STR2__ #undef __STR1__ #undef __WARNING_MESSAGE__ #undef __NORMAL_MESSAGE__ #define __S... 阅读全文

posted @ 2008-10-25 13:01 活着就是幸福 阅读(183) 评论(0) 推荐(0) 编辑

摘要:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->inline bool IsSpace(Char c) // Space, tabulation, line feed or return { return(c == TEXT(... 阅读全文

posted @ 2008-10-25 12:29 活着就是幸福 阅读(226) 评论(0) 推荐(0) 编辑

摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->std::wofstream fout( filename.c_str(), std::ios::out ); fout.imbue(std::locale("chs"));fout<<somes... 阅读全文

posted @ 2008-10-25 12:24 活着就是幸福 阅读(791) 评论(0) 推荐(0) 编辑

摘要:CString转std::wstring std::wstring str = filename.GetString(); std::wstring转CString CString str( filename.c_str() ); 阅读全文

posted @ 2008-10-25 12:23 活着就是幸福 阅读(7793) 评论(0) 推荐(0) 编辑