As the title says, I have this code:
typedef struct Book{
int id;
char title[256];
char summ
Want to add by clarifying when you actually declare a variable.
struct foo {
int a;
} my_foo;
defines foo and immediately declares a variable my_foo of the struct foo type, meaning you can use it like this my_foo.a = 5;
However, because typedef syntax follows typedef
typedef struct bar {
int b;
} my_bar;
is not declaring a variable my_bar of type struct bar, my_bar.b = 5; is illegal. It is instead giving a new name to the struct bar type in the form of my_bar. You can now declare the struct bar type with my_bar like this:
my_bar some_bar;