c++ structr code example
Example 1: c++ struct constructor
struct TestStruct {
int id;
TestStruct() : id(42)
{
}
};
Example 2: what is a struct in c++
struct Person
{
char name[50];
int age;
float salary;
};