C struct and C++ class structure is similar but by the default they have a difference in data hiding.
In struct doesn’t provide data hiding by default but class provides data hiding by default.
And the other difference is, class provides us to polymorphism and inheritance features.
We said class structure data hiding is coming default but what it means?
It means when we have a struct it is public by default so we can access our struct model wherever are we

struct car{

staticint *model;

int *horsePower;

string *producer;

}

car myCar;

By myCar i can access my model,horsePower or producer because it works like public variable but same structure with class
like Read the rest of this entry »