Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class A{
- public:
- int m_a;
- public:
- A(int a): m_a(a){
- cout << "A class " << m_a;
- }
- };
- class B: public A{
- public:
- int m_b;
- public:
- B(int a,int b): A(a), m_b(b){
- cout << "\nB class " << m_a << " " << m_b;
- }
- };
- int main(){
- B *b = new B(12, 5);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement