We use structures to describe the format of a number of related variables. For example, we want to store details of 100 textbooks it will become difficult to declare and maintain 100 variables and store the data. Instead, we can declare and array of structure variables as shown below: 1 2 3 4 5 6 7 struct textbook { char name; char author; int pages; } struct textbook book; In the above example, we are declaring an array book with 10 elements of the type textbook which is a structure. Structures within Structure In C, structures can be nested.
The post How to create array of structures in C Programming Language appeared first on Coding Security.
How to create array of structures in C Programming Language
read more
Tidak ada komentar:
Posting Komentar