Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class X {
- protected:
- const static int i = 1;
- public:
- void print() {cout << i;}
- };
- class Y : public X {
- const static int i = 2;
- public:
- void print() {cout << i;}
- };
- int main(int argc, char* argv[]) {
- Y y;
- y.print();
- ((X)y).print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement