iOS Crazies

typedef,typeof;

2016-11-23  本文已影响20人  hehtao

typedef用来定义类型别名,c/c++里都有,属于语言的一个特性,和mfc无关
比如

typedef int* intptr;
intptr a; // 相当于int* a;

typeof,我所知道的是gcc中对c/c++语法的一个扩展,用来静态获取参数类型
比如

int a = 3;
typeof(a) b = 4; // 相当于 int b = 4;
typeof("12345") c = "abcde"; // 相当于 const char c[6] = "abide"
上一篇下一篇

猜你喜欢

热点阅读