typedef的几个用法

    技术2022-05-20  41

    typedef int int32_t;

    int a;

    等价于

    int32_t a;

     

    typedef int *pint32_t;

    int *pa;

    等价于

    pint32_t pa;

     

    typedef char string[32];

    char s[32];

    等价于

    string s;

     

    typdef int (*fntype)(int);

    fntype fnptr;

    fnptr为函数指针,可以指向如下类型的函数

    int func(int a);

     

     

     

     


    最新回复(0)