In C, is it good form to use typedef for a pointer?

前端 未结 8 1778
野性不改
野性不改 2021-01-06 10:46

Consider the following C code:

typedef char * MYCHAR;
MYCHAR x;

My understanding is that the result would be that x is a pointer of type \"

8条回答
  •  长发绾君心
    2021-01-06 11:26

    I prefer leaving the *, it shows there's a pointer. And your second example should be shortened as char* x;, it makes no sense.

提交回复
热议问题