Skip to main content

Posts

Showing posts with the label Array of structure

Array of structure in C programming

     Like array of int, float or char type, there may be array of structure. In our previous structure example, if we want to keep record of more students, we can make more structure variables like st1, st2, st3, ….so on. But this technique is inefficient. At this situation, we can use array of structure. The array of structure is declared as            struct  structure_variable[size_of_array];       This is illustrated by following program. Example:         Modify the above program such that it works to keep records of five students. Use array of structure. void main()   {   struct student {                        char name[20];               ...