09 b] Give the general syntax to initialize a structure to store a Book information
After defining a structure format we have declare variables of that type. A Structure variable declaration is similar to the declaration of variables of any other data types.
It includes the following elements.
- The keyword struct.
- The structure tag name.
- List of variable names separated by commas.
- A terminating semicolon.
For example: syntax
struct book_bank book1, book2, book3;
declares book1, book2 and book3 as variables of type struct book_bank.
The complete declaration look like OR it can also be done like given below:
struct book_bank
{
char title[20];
char author[15];
int pages;
float price;
}book1, book2, book3;