I am currently using a C++ IDE for something that will need to work on C, and wanted to make sure that I won't have problems with this later on. After making the struct below:
typedef struct test {
int a;
int b;
};
I then create an instance of it using
test my_test;
then stuff like my_test.a = 5
, etc... and this works fine in my VStudio C++.
Is this going to work on gcc
later on?
I read the related questions that popped up (I see I am not the first person with this kind of question, either) but no one seemed to use the way I did.
In fact, what is the difference between typedef struct {//stuff} test;
and my version?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…