First you need to make Point the following type:
typedef struct Point {
int x;
int y;
} Point;
This allows use Pointas a type, orstruct Point
i.e:
Point *p;
sizeof(struct Point);
Some people prefer the structure name to be different from the type being created, for example:
typedef struct _point {
...
} Point;
You will encounter both. The last example tells me that I should not use struct _point, it cannot be used, except as a type Point.
source
share