How can I hide the declaration of a struct in C?

前端 未结 6 1119
一整个雨季
一整个雨季 2020-12-05 01:13

In the question Why should we typedef a struct so often in C?, unwind answered that:

In this latter case, you cannot return the Point by value, sinc

6条回答
  •  误落风尘
    2020-12-05 01:47

    What that post means is: If you see the header

    typedef struct _Point Point;
    
    Point * point_new(int x, int y);
    

    then you don't know the implementation details of Point.

提交回复
热议问题