[ create a new paste ] login | about

Link: http://codepad.org/NQ3JNuRr    [ raw code | output | fork ]

C++, pasted on Jul 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>
using namespace std;

class A{
public:
  void fun(){cout<<"fun\n";}
};

class B: public A{
  void fun(int i){cout<<"funB\n";}
};

int main()
{
  B b;
  b.fun();
}


Output:
1
2
3
In function 'int main()':
Line 16: error: no matching function for call to 'B::fun()'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: