+ 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
2 Answers
- 1
Structs are custom data types.
"Books" is the name of said data type.
"book" is the name of a variable of type Books.