In what scenarios is it better to use a struct
vs a class
in C++?
Technically both are the same in C++ - for instance it's possible for a struct to have overloaded operators etc.
However :
I use structs when I wish to pass information of multiple types simultaneously I use classes when the I'm dealing with a "functional" object.
Hope it helps.
#include
#include
For instance, I'm returning a struct student in the get...() methods over here - enjoy.