Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- class A{
- public:
- int a;
- void show(){
- cout<<a<<endl;
- }
- };
- class B: public A{
- public:
- int b;
- void getvalue(){
- cin>>a>>b;
- }
- void show(){
- cout<<b<<endl;
- }
- };
- int main(){
- B obj;
- obj.getvalue();
- obj.A::show();
- obj.B::show();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment