struct examples in cpp
Example 1: what is a struct in c++
struct Person
{
char name[50];
int age;
float salary;
};
Example 2: c++ structure
struct product {
int weight;
double price;
} ;
product apple;
product banana, melon;
struct Person
{
char name[50];
int age;
float salary;
};
struct product {
int weight;
double price;
} ;
product apple;
product banana, melon;