Chinaunix首页 | 论坛 | 博客
  • 博客访问: 767923
  • 博文数量: 247
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 501
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-12 21:53
个人简介

系统未建立

文章分类

全部博文(247)

文章存档

2021年(1)

2020年(3)

2019年(5)

2018年(3)

2017年(44)

2016年(75)

2015年(52)

2014年(63)

2013年(1)

我的朋友

分类: C/C++

2020-02-05 19:41:12

 










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;
}
 








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