+ 1
Why use two names when defining a struct? (C)
Hi, so I was wondering why when, for example, in the code at the end of the message, they define a structure named "book" by using: typedef struct Books { ... } book; instead of using typedef struct { ... } book; What's the point of writing "Books" after typedef struct? Thanks in advance. https://www.tutorialspoint.com/cprogramming/c_typedef.htm
1 Odpowiedź
- 1
Structs are custom data types.
"Books" is the name of said data type.
"book" is the name of a variable of type Books.