C structure revisited
Structure is a user defined data type containing different data types.
struct student
{
char name[20];
int roll_no;
float avg_marks;
};
struct student a;
• The variable a is of type student and has three member variables.
• Member variables can be accessed using dot operator
{
char name[20];
int roll_no;
float avg_marks;
};
struct student a;
• The variable a is of type student and has three member variables.
• Member variables can be accessed using dot operator
a.roll_no = 4237;
Tags:
Cpp