Using struct we can achieve all the functionalities of a class:
- constructors, destructors
- member functions, static functions.
- overloaded functions, virtual functions
- public / private / protected access specifiers.
- operators
The only difference are the default access rights: private for class, public for struct.
Why do we need a Class then ?
IIRC when C++ was created (as C with classes), a design goal was to only ever add functionality, so the initial idea was to have a class as in C++, and a struct as in C. But then things got blurred, and in the following 20 years struct “mutated” into some kind of class.