守望远方

热爱生活 热爱工作 守望远方

2012年12月27日

网狐棋牌游戏平台服务器架构设计分析(转)

摘要: 网狐棋牌游戏平台服务器架构设计分析 阅读全文

posted @ 2012-12-27 12:00 守望远方 阅读(1548) 评论(0) 推荐(0) 编辑
传参方法:sharedApplication, NSUserDefaults, protocol 和 delegate(实例)

摘要: 1. iOS开发中使用[[UIApplication sharedApplication] openURL:] 加载其它应用 2. NSUserDefaults读取和写入自定义对象 3. protocol 和 delegate 回调函数传值 阅读全文

posted @ 2012-12-27 10:36 守望远方 阅读(196) 评论(0) 推荐(0) 编辑
《C++ Primer》笔记-引用

摘要: int ival = 1024; int &refVal = ival; // ok: refVal refers to ival int &refVal2; // error: a reference must be initialized int &refVal3 = 10; // error: initializer must be an object 阅读全文

posted @ 2012-12-27 10:29 守望远方 阅读(209) 评论(0) 推荐(0) 编辑
《C++ Primer》笔记-const与extern

摘要: 一般变量:如我在file_1.cpp中定义了一个变量,在file_2.cpp中我想使用它,那么我只需要在file_2.cpp中用extern声明它就可以用了: // file_1.cc int counter; // definition // file_2.cc extern int counter; // uses counter from file_1 ++counter; // increments counter defined in file_1 const变量:除非特别说明,const变量只作用与file1中,不能被其他文件访问。 此时若还想在file2中使用它,那么在file1中也要声明它为extern的。 阅读全文

posted @ 2012-12-27 10:17 守望远方 阅读(410) 评论(0) 推荐(0) 编辑
《C++ Primer》笔记-声明与定义

摘要: extern 声明不是定义,也不分配存储空间。事实上,它只是说明变量定义 在程序的其他地方。程序中变量可以声明多次,但只能定义一次。 extern double pi = 3.1416; // definition extern double pi; // ok: declaration not definition extern double pi = 3.1416; // error: redefinition of pi 阅读全文

posted @ 2012-12-27 09:51 守望远方 阅读(165) 评论(0) 推荐(0) 编辑
《C++ Primer》笔记-C++变量初始化

摘要: C++ 支持两种初始化变量的形式:复制 初始化和直接初始化。复制初始化语法用等号(=),直接初始化则是把初始化 式放在括号中: int ival(1024); // direct-initialization int ival = 1024; // copy-initialization 这两种情形中,ival 都被初始化为 1024。 阅读全文

posted @ 2012-12-27 09:29 守望远方 阅读(510) 评论(0) 推荐(0) 编辑

2012年12月26日

NSNull

摘要: The NSNull class defines a singleton object used to represent null values in collection objects (which don’t allow nil values). + (NSNull *)null: Returns the singleton instance of NSNull. 如果要向一个字典,或数组 加入空对象可以加 [NSNull null] 阅读全文

posted @ 2012-12-26 17:58 守望远方 阅读(384) 评论(0) 推荐(0) 编辑
《C++ Primer》笔记-由1.0f引发的

摘要: 默认的浮点字面值常量为 double 类型。在数值的 后面加上 F 或 f 表示单精度。同样加上 L 或者 l 表示扩展精度(再次提醒, 不提倡使用小写字母 l)。 阅读全文

posted @ 2012-12-26 17:25 守望远方 阅读(985) 评论(0) 推荐(0) 编辑
《C++ Primer》笔记-C++ 基本数据类型

摘要: 字符类型有两种:char 和 wchar_t。char 类型保证了有足够的空间,能够 存储机器基本字符集中任何字符相应的数值,因此,char 类型通常是单个机器 字节(byte)。wchar_t 类型用于扩展字符集,比如汉字和日语,这些字符集中 的一些字符不能用单个 char 表示。 阅读全文

posted @ 2012-12-26 16:40 守望远方 阅读(176) 评论(0) 推荐(0) 编辑
《C++ Primer》笔记-调用 GNU 或微软编译器编译C++程序

摘要: $ g++ prog1.cc -o prog1 这里的 $ 是系统提示符。这个命令产生一个为 prog1 或 prog1.exe 的 可执行文件。在 UNIX 系统下,可执行文件没有后缀;而在 Windows 下, 后缀为 .exe。-o prog1 是编译器参数以及用来存放可执行文件的文件 名。如果省略 -o prog1,那么编译器在 UNIX 系统下产生名为 a.out 而 在 Windows 下产生名为 a.exe 的可执行文件。 阅读全文

posted @ 2012-12-26 10:42 守望远方 阅读(389) 评论(0) 推荐(0) 编辑