c语言特殊语法(六)typeof的用法

1190阅读 0评论2020-02-05 wzzushx
分类:C/C++

 










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








上一篇:Linux Ldd命令介绍及使用方法
下一篇:gdb编译问题记录