Либо выполните:
typedef struct {
float x;
float y;
} coords;
coords texCoordinates[] = { {420, 120}, {420, 180}};
ИЛИ
struct coords {
float x;
float y;
};
struct coords texCoordinates[] = { {420, 120}, {420, 180}};
В C struct
имена находятся в другом пространстве имен, чем typedef
s.
Конечно, вы также можете использовать typedef struct coords { float x; float y; } coords;
и использовать struct coords
или coords
.В этом случае не имеет значения, что вы выберете, но для самообращающихся структур вам нужно имя структуры:
struct list_node {
struct list_node* next; // reference this structure type - need struct name
void * val;
};