I\'ve just started learning C with a professional Java background and some (if no too much) C++ knowledge, and I was astonished that this doesn\'t work in C:
str
You first need to make Point a type like :
typedef struct Point {
int x;
int y;
} Point;
This allows you to use Point
as a type, or struct Point
I.e:
Point *p;
sizeof(struct Point);
Some people prefer to make the name of the structure different from the type being created, such as:
typedef struct _point {
...
} Point;
You'll run into both. The last example tells me that I should not use struct _point
, its not meant to be exposed except as the type Point
.