use struct in c++ class code example
Example 1: what is a struct in c++
struct Person
{
char name[50];
int age;
float salary;
};
Example 2: struct c++
//Struct is a compound data type that contains different variables of different types.
struct Student
{
char stuName[30];
int stuRollNo;
int stuAge;
};