How structure in C is different from the union? Give example

10.A) How structure in C is different from the union? Give example

Answer:-

Example of Structure

struct student 
{  
    int rollno;  
    char name[50];  
    string phone;  
 
};  

Example of Union

union Student {
   char name[32];
   int age;
   string email;  
};

Leave a Reply

Your email address will not be published. Required fields are marked *