Is typedef ever required in C?

前端 未结 15 2846
夕颜
夕颜 2021-02-13 14:19

Typedef is very useful for portable names, tag names (typedef struct foo Foo;) and keeping complicated (function) declarations readable (typedef int (*cmpfunc

15条回答
  •  南方客
    南方客 (楼主)
    2021-02-13 14:52

    We use typedef to at work keep code platform independent. Like for example, we do something like

    typedef unsigned char SHORT;
    

    this makes code more readable and easy to port.

提交回复
热议问题