Chinaunix首页 | 论坛 | 博客
  • 博客访问: 162249
  • 博文数量: 25
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 319
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-12 21:27
文章分类

全部博文(25)

文章存档

2015年(2)

2014年(1)

2013年(22)

我的朋友

分类: C/C++

2013-05-19 12:11:55

 










typeof是获取变量的类型。
具体使用看看下面的代码你就懂了。


#include

struct _struct_t
{
}struct_t;

void fun()
{
    printf("OK\n");
}


int main(int argc,char *argv[])
{
    int a;
    char b;
    void (*p)(void);

    typeof(a) aa;
    typeof(b) bb;
    typeof(p) pp;
    typeof(struct_t) struct_tt;

    pp = &fun;
    pp();

    return 0;
}
 








阅读(9225) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~