+ 2
i have a structre related doubt ?
this code works fine:- #include<stdio.h> typedef struct{ int b; }abc; int main() { abc A; A.b = 10; printf("%d",A.b); return 0; } But not this:- #include<stdio.h> struct{ int b; }; int main() { struct A; A.b = 10; printf("%d",A.b); return 0; } Why
2 Answers
+ 2
You didn't declare the structure in the second code correctly
struct struct_A{
int b;
};
int main()
{
struct struct_A A;
A.b = 10;
printf("%d", A.b);
return 0;
}
+ 2
ROBIN thanks for your help
now i understand the error as well
ONUR yes now those errors are making sense to me
thanks to u both