aytdev

ambiguity-c201050

Apr 11th, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. class A{
  4.  
  5. public:
  6. int a;
  7. void show(){
  8. cout<<a<<endl;
  9. }
  10.  
  11.  
  12. };
  13. class B: public A{
  14.  
  15. public:
  16. int b;
  17. void getvalue(){
  18. cin>>a>>b;
  19. }
  20. void show(){
  21. cout<<b<<endl;
  22.  
  23. }
  24.  
  25. };
  26. int main(){
  27. B obj;
  28. obj.getvalue();
  29. obj.A::show();
  30. obj.B::show();
  31.  
  32. return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment