fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A {
  5. public:
  6. A( int ) { cout << "A int " << endl;}
  7. A( const char* a ) { cout << "A: " << a << endl;}
  8. };
  9.  
  10. class B : public A {
  11. public:
  12. using A::A;
  13. B( const char* a ) : A( a ) { cout << "B: " << a << endl; }
  14. };
  15.  
  16.  
  17.  
  18. int main() {
  19. // your code goes here
  20. B b1( "hello" );
  21. B b2( 2 );
  22. return 0;
  23. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
A: hello
B: hello
A int