Typedeffing a function (NOT a function pointer)

前端 未结 6 2241
醉酒成梦
醉酒成梦 2020-12-17 05:20
typedef void int_void(int);

int_void is a function taking an integer and returning nothing.

My question is: can it be

6条回答
  •  天涯浪人
    2020-12-17 05:54

    You are not declaring a variable; you are making a forward declaration of a function.

    typedef void int_void(int);
    int_void test;
    

    is equivalent to

    void test(int);
    

提交回复
热议问题