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