728x90
반응형
728x90
반응형
728x90
반응형
// overloading on the c++
// code from http://www.winapi.co.kr/
#include <stdio.h>
#include <process.h>
class B
{
public:
void f(int a) { puts("B::f(int)"); }
void f(double a) { puts("B::f(int)"); }
};
class D : public B
{
public:
void f(char *a) { puts("D::f(char *)"); }
};
void main()
{
D d;
d.f(""); // OK!!
d.f(1); // ERROR ( it's Invisible !!)
d.f(2.3); // ERROR
system( "pause" );
}
728x90
반응형

+ Recent posts