In C++, since you can have class-instances as members in structs, the compiler has an implicit destructor just like classes to clean them up. I can invoke a destructor of a class when I allocate an object into my own memory with the fixed-memory new-operator and need to clean it up, but what if I allocate a struct the same way? I know one workaround is to call the destructor of each class instance in the struct, just wondering if there was a way.
In C++, since you can have class-instances as members in structs, the compiler has
Share
The same rules that apply to classes also apply to structs. The only difference between
classandstructis the default access level, and no other.