Do structures support inheritance? I think it's stupid question, but I have not much idea about it.
What is the meaning of writing code like this:
struct A {
void f() { cout << "Class A" << endl; }
};
struct B: A {
void f() { cout << "Class B" << endl; }
};
In structures also private section will come, don't they give encapsulation? What is the major difference between structures and classes?