Or do:
typedef struct {
float x;
float y;
} coords;
coords texCoordinates[] = { {420, 120}, {420, 180}};
OR
struct coords {
float x;
float y;
};
struct coords texCoordinates[] = { {420, 120}, {420, 180}};
In C, structnames are in a different namespace than typedefs.
Of course, you can also use typedef struct coords { float x; float y; } coords;and use either struct coords, or coords. In this case, it does not matter what you choose, but for structures with self-refraction, you need the name of the structure:
struct list_node {
struct list_node* next;
void * val;
};
source
share