struct is the exact same as class except it is public by default instead of private. They are mainly used to combine multiple variables into one object. For example
1 2 3 4 5 6
struct Person
{
int age;
string name;
string favoriteColor;
}
is the same as
1 2 3 4 5 6 7
class Person
{
public:
int age;
string name;
string favoriteColor;
}
and it can be used like
1 2 3 4 5 6 7
int main()
{
Person me;
me.age = 23;
me.name = "Brandon";
//ect...
}