Array of Structure in C Programming

March 1, 2010 No Comments » Hits : 160






Array of Structure :

Introduction :
Structure is used to store the information of One particular object but if we need to store such 100 objects then Array of Structure is used. 

Example :

struct Bookinfo{      char[20] bname;      int pages;      int price;}Book[100];

Explanation :

  1. Here Book structure is used to Store the information of one Book.
  2. In case if we need to store the Information of 100 books then Array of Structure is used.
  3. b1[0] stores the Information of 1st Book , b1[1] stores the information of 2nd Book and So on We can store the information of 100 books.

book[3]  is shown Below

Accessing Pages field of Second Book :

Book[1].pages

Bookmark & Share

Incoming search terms: