摘要: /** 被static修饰的局部变量 1.只有一份内存, 只会初始化一次 2.生命周期会持续到程序结束 3.static改变了局部变量的生命周期, 但是不能改变局部变量的作用域 被static修饰的全局变量 1.作用域仅限于当前文件(任何文件不能通过extern来引用这个全局变量) 2.stati... 阅读全文
posted @ 2015-10-13 19:59 吃饭了吗 阅读(169) 评论(0) 推荐(0)
摘要: /* int const *p; *p是常量, p是变量 const int *p; *p是常量, p是变量 int * const p; *p是变量, p是常量 const int * const p; *p是常量, p是常量 ... 阅读全文
posted @ 2015-10-13 19:50 吃饭了吗 阅读(297) 评论(0) 推荐(0)
摘要: clang -rewrite-objc main.m#import #import // clang -rewrite-objc main.m// 生成main.m转成C\C++后的代码//int age = 20;int main(int argc, const char * argv[]) { ... 阅读全文
posted @ 2015-10-13 18:58 吃饭了吗 阅读(1607) 评论(0) 推荐(0)
摘要: #import #import "XMGPerson.h"#import "XMGStudent.h"#import #import /** 1.什么是运行时(runtime)? 1> 是苹果官方提供的一套纯C语言库 2> 平时编写的OC代码最终都是转换成了运行时(runtime)C语言代码 // ... 阅读全文
posted @ 2015-10-13 17:15 吃饭了吗 阅读(311) 评论(0) 推荐(0)