To declare a class object we need the format
classname objectname;
Is it the sameway to declare a structure object?
like
structname objectname;
I found here a structure object declared as
struct Books Book1;
where Books is the structure name and Book1 is its object name. So is there any need of usinge the keyword struct
before declaring a structure object?
You have to typedef them to make objects without struct keyword
example:
typedef struct Books {
char Title[40];
char Auth[50];
char Subj[100];
int Book_Id;
} Book;
Then you can define an object without the struct keyword like:
Book thisBook;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With