I’m trying to do this:
typedef struct {
float x;
float y;
} coords;
struct coords texCoordinates[] = { {420, 120}, {420, 180}};
But the compiler won’t let me. : ( What’s wrong with this declaration? Thanks for your help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either do:
OR
In C,
structnames reside in a different name space thantypedefs.Of course you can also use
typedef struct coords { float x; float y; } coords;and use eitherstruct coordsorcoords. In this case it won’t matter what you choose, but for self-referencing structures you need a struct name: