In fact, in C++ structs and classes are the same thing, only struct declarations starts with public visibility by default and class declarations starts with private visibility by default.
That's their only difference in C++.
And so instances of structs and instances of classes are the same thing in C++ too.
You will even sometimes see member functions defined on structs.
That's their only difference in C++.
And so instances of structs and instances of classes are the same thing in C++ too.
You will even sometimes see member functions defined on structs.