CGFloat height = 20;
- 声明变量height,同时定义变量
extern CGFloat height;
- extern用来在不同的文件中共享height变量,提示编译器height是在程序中其他位置定义的,因此不需要为height分配空间
static int i = 0;
- in the C programming language,static is used with global variables to set their scope to the containing file,In local variables,static is used to store the variable in the statically allocated memory instead of the automatically allocated memory.
网友评论