+ 8
What is the difference between this two declarations
struct p{ int x,y; }; and struct { int x,y; } p;
7 Antworten
+ 4
The first declare a struct with name p. The second declare a variable p than refer to an unamed struct
+ 6
so I can not declare an instance of p in second example
How can I use the second way ?
+ 6
I got it thanks master KrOW
Soo it is just an instance of unnamed struct
+ 4
What is the benefit of unnamed struct or how I can write a fucntion that returns an instance of unnamed struct
+ 4
What is exactly happening when I write "typedef" befor unnamed struct
Why The address of unnamed struct was just in digits
Thanks for help
+ 3
No because p is not a struct but it will be yet an instance of an unamed struct (eg you can access to members like p.x or p.y)