Class Versus Struct
- by Prometheus87
In C++ and other influenced languages there is a construct called Structure (struct) and we all know the class. Both are capable of holding functions and variables. some differences are
1. Class is given memory in heap and struct is given memory in stack
2. in class variable are private by default and in struct thy are public
My question is that struct was somehow abandoned for Class. Why? other that abstraction, a struct can do all the same stuff a class does. Then why abandon it?