//myStructInheritance1.cpp #include #include using namespace std; struct A{ string greetings ; void record(string str1); }; void A::record(string str1) { cout<<"\n "<< " " << str1; } struct B:A{}; struct C:A{}; int main() { B b;C c; b.greetings="welcome"; cout<<"\n "<< b.greetings; b.record("Manas"); c.record("from USA"); return 0; }