Let us revisit the C structure for understanding the C++ programming

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
  a.roll_no = 4237;

Post a Comment

Previous Post Next Post