typedef[1]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 acqy 的 blog

c/c++语言中的typedef相信大家已经不陌生,本文对c/c++语言关键字typedef的各种用法作一个介绍。

typedef,顾名思义,为“类型定义”,可以解释为:将一种数据类型定义为某一个标识符,在程序中使用该标识符来实现相应数据类型变量的定义。例如:

 

typedef unsigned int uint;

int main (int argc, char *argv[])

{

    unsigned int a;   // it’s ok

    uint b;    // it’s ok, a and b are of the same type (int)

    // . . .   // code references the symbol a and b

    return 0;

}

 

本文关键:typedef
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top