Created
July 14, 2010 09:52
-
-
Save ybenjo/475257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class TEST1{ | |
typedef int id; | |
public: | |
A(){}; | |
void set(id n){ | |
x = n; | |
}; | |
void show(){ | |
cout << x << endl; | |
}; | |
id x; | |
}; | |
class TEST2 : public TEST1{ | |
typedef string id; | |
public: | |
B(){}; | |
}; | |
int main(){ | |
TEST1 test1; | |
test1.set(100); | |
test1.show(); | |
TEST2 test2; | |
test2.set("100"); | |
test2.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment