(A)   Solution 1                                                Solution 2

struct student                     typedef struct

{                                  {

   char ssn[10];                      char ssn[10];

   char names[3][21];                 char names[3][21];

   float gpa;                         float gpa;

};                                  } STUDENT;

 

(B)  Using structure of solution 1                Using structure of solution 2

struct student studentA;           STUDENT studentA;

 

 

(C)

strcpy (studentA.ssn, “123456789”);

strcpy (studentA.names[0], “Ima”);

strcpy (studentA.names[1], “College”);

strcpy (studentA.names[2], “Student”);

studentA.gpa = 3.85;

 

 

(D)

pStudent = &studentA;

 

 

(E)

printf (“%s\n”, pStudent->names[2]);

or

printf (“%s\n”, (*pStudent).names[2]);

 

 

Explanation