English

How to Create Array of Structure Variable and Assign Values to Its Members? - Structured Programming Approach

Advertisements
Advertisements

Question

How to create array of structure variable and assign values to its members?

Short Note

Solution

1. An array of structure can be declared in the same way as declaring array of any other data type.
2. For example, an array of the structure student can be declared as shown:
struct student s[100];
This array can now store information of 100 students.
3. Array of structure must be used when many variables of a structure are required.
4. Syntax:
Struct structure_name
{
data_type member1;
data_type member2;
-
-
data_type member;
};

shaalaa.com
Array
  Is there an error in this question or solution?
2017-2018 (June) CBCGS

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×