Is memory allocation for class (when initializing an object) is the same as struct? I know that when we initialize struct,
struct example {
int a;
double b;
int c;
}
the memory allocated will be = (0-4) int, (8-16) double, (16-20) int. (If I am not mistaken)
What if we want to initialize
class Example {
private:
int a;
double b;
int c;
public:
Example();
}
Example object();
?
What's the memory allocation behavior when the object is initialized? Is it the same as struct?