2008年10月25日

摘要: 模板类的函数定义最好写在类体里面或者写在紧紧跟随类体定义的后面,如果写在CPP里就会发生"warning LNK4221: no public symbols found; archive member will be inaccessible" 警告.当然还有一种方法是写在.inc文件里,在头文件的最后include 这个inc文件.算半个隐藏方法吧. 阅读全文

posted @ 2008-10-25 12:31 活着就是幸福 阅读(979) 评论(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 活着就是幸福 阅读(795) 评论(0) 推荐(0) 编辑

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

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

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1#include 2using namespace std; 3 4template 5class sample 6{ 7public: 8 9 friend ost... 阅读全文

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

摘要: 下载地址:http://files.cnblogs.com/wswqwps/CharAnim.zip 其实可以读入N幅连续的图片,识别, 转换,保存成字符数组文件,读取,播放。 这就是个super mini的另类引擎了。 阅读全文

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

摘要: 4. 非类型模板参数 4.1 非类型类模板参数 1.非类型参数里面,比如Stack;每个模板实例是自己的类型 Stack 和Stack是不同类型 2.可以给非参数类型指定默认参数(参数类型也仍然可以指定),但从设计上来说可能 不太好 4.2 非类型函数模板参数 模板参数不能被用来进行模板参数推演(意思就是把函数作为参数放在别... 阅读全文

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

摘要: 3 类模板 3.1类模板声明 1.可以使用typename 或者class 关键字,不能使用struct 2.在头部放置template 3.使用模板类作为类型来声明时,要使用classname的形式 4.定义类成员函数时应该说明是函数模板(使用template) 同时使用类模板的完全类型限定 【插曲:源代码说明... 阅读全文

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

摘要: 2.1 函数模板 1.template参数定义中,typename 和class 可以互换,尽量使用typename,不可以使用struct 2.模板参数可以使用任意类型,包括内置类型,自定义类,枚举等 3.模板参数名称可以使用任意名称 4.函数模板不是只编译一份满足多重需要,而是为每一种实例化类型编译一份 5.只有函数模板的使用才会引发实例化 6.为某种类型实例化模板,而此类型不完全支持模... 阅读全文

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

2008年10月24日

摘要: 1.4 程序风格提示 const 1. const type varname 等价于 type const varname 2. const type * varname 不等价于 type * const varname 3. const type * varname 内容为常量,指针可指向别处 4. type * const varname 指针本身为常量,但可修改所... 阅读全文

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

摘要: 面试官:熟悉哪种语言?应聘者:汉式语言。 面试官:知道什么叫类么? 应聘者:我这人实在,工作努力,不知道什么叫累. 面试官:知道什么是包?应聘者:我这人实在,平常不带包,也不用公司准备了. 面试官:知道什么是接口吗? 应聘者:我这个人工作认真。从来不找借口偷懒. 面试官:知道什么是继承么?应聘者:我是孤儿,没什么可以继承的. 面试官:知道什么叫对象么?应聘者:知道,不过我工作... 阅读全文

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

摘要: csdn的系统实在是太烂了。申请一个cnblogs的过来用用试试。搬家了。 阅读全文

posted @ 2008-10-24 15:01 活着就是幸福 阅读(131) 评论(3) 推荐(0) 编辑