上一页 1 ··· 7 8 9 10 11 12 下一页
摘要: # 函数模板## 1.定义> 函数模板是通用的函数描述,也就是说,它们是使用泛型来定义函数。由于模板允许泛型的方式编写程序,一次有时也被称为通用编程## 2.一般形式``` template return_type FuncName(args...){}```## 3.重载的模板 重载的模板... 阅读全文
posted @ 2014-11-09 23:19 zyh_think 阅读(236) 评论(2) 推荐(0) 编辑
摘要: # C++左值> * 左值参数是可被引用的数据对象。比如,变量,数组元素,结构成员,引用和解引用指针> * 非左值包含字面常量(用引号括起的字符串除外,它们是由地址表示的)和包含多项的表达式> * 在C语言里面左值最初指的是出现在赋值语句左边的实体,但是这是在引入const之前。现在,常规变量和co... 阅读全文
posted @ 2014-11-09 14:19 zyh_think 阅读(218) 评论(0) 推荐(0) 编辑
摘要: # cocos2d-x 不规则形状按钮的点击判定> * 原理: 1.OpeGL ES提供了glReadPixels[^footnote]函数,来获取当前framebuffer上的像素数据 2.cocos2d-x 提供了一个CCRenderTexture,它会帮我们初始化一块framebu... 阅读全文
posted @ 2014-11-05 21:46 zyh_think 阅读(1669) 评论(0) 推荐(0) 编辑
摘要: ## C/C++ - 结构体实际申请的空间1. 如下的结构体,`sizeof()`大小,实际申请的空间以及理论上申请最佳空间```struct Spot{ int x; int y; bool visible; int red; int blue; int gre... 阅读全文
posted @ 2014-11-04 20:41 zyh_think 阅读(1908) 评论(0) 推荐(0) 编辑
摘要: (ctype.h)Character handling functionsThis header declares a set of functions to classify and transform individual characters.FunctionsThese functions... 阅读全文
posted @ 2014-10-24 13:36 zyh_think 阅读(181) 评论(0) 推荐(0) 编辑
摘要: C++ 字符串字面值C++ 基本字符串类型C++ 字符串类型 char 和 wchar_tc11 新增了 char16_t 和 char32_t例子: wchat_t title[] = L"char_t"; // w_char string char16_t name[] = u"char... 阅读全文
posted @ 2014-10-23 17:24 zyh_think 阅读(418) 评论(0) 推荐(0) 编辑
摘要: C++ 拼接字符串常量C++允许拼接字符串字面值,即将两个用引号括起的字符串合并为一个。事实上,任何两个由空白(空格,制表符和换行符)分隔的字符串常量都将自动拼接成一个。例子:cout 输出结果“prev string next string” 阅读全文
posted @ 2014-10-23 15:22 zyh_think 阅读(197) 评论(0) 推荐(0) 编辑
摘要: OpenGL中在窗口的大小发生变化的时候会触发resize()函数,这里会传入一个新的宽和高,在resize()函数中我们会设置投影矩阵,在可以使用OpenGL基础函数glFrustum()函数和glu函数gluPerspective()函数。网上介绍两个函数联系比较少,所以自己研究呗。OpenGL... 阅读全文
posted @ 2014-10-23 15:22 zyh_think 阅读(2706) 评论(0) 推荐(0) 编辑
摘要: The conceptCompareis a set of requirements expected by some of the standard library facilities from the user-provided function object types.The return... 阅读全文
posted @ 2014-10-18 00:08 zyh_think 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 1.头文件命名约定头文件类型约定示例说明C++旧式风格以.h结尾iostream.hC++程序可以使用C 旧式风格以.h结尾math.hC、C++程序可以使用C++新手风格无扩展名iostreamC++程序可以使用,使用namespace std转换后的C加上前缀C,无扩展名cmathC++程序可以... 阅读全文
posted @ 2014-09-28 20:12 zyh_think 阅读(169) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 下一页