User Profile
Collapse
-
Oh, I solved the problem by johny, I have a little opinion about the using of the keyword struct. I think the struct verb is the new data struct by yourself, that you can't put definition of the struct in the program file, or the compile machine say the struct is not define, so, you can not do this like use int, char or other data struct that define in c compile. That in other C file is already know the int or char data struct, so you can int a in... -
Thank you, I think I am a new man, I want you tell me how can I define struct verb in test.h,may is define extern struct image ss in the test.h. That struct image{
int a;
char b;
}; in test.c
I do this but failed!
Thank you, Thank you!Leave a comment:
-
how to use the struct in C
I create two C files, one is main.c and another is test.c,and then I defined an struct verb in test.c:
struct image{
int a;
char b;
};
struct image ss;
void test() {
ss.a = 10;
}
I want to use the struct verb ss in the main.c,but I failed. Please help me how can I use the struct verb ss in the main.c.
Thank you very much
No activity results to display
Show More
Leave a comment: