Created
April 10, 2014 16:37
-
-
Save madbence/10400351 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<stdio.h> | |
struct Alma { | |
Alma& foo() { return *this; } | |
virtual void bar() { printf("alma"); } | |
}; | |
struct Belma: public Alma { | |
void bar() { printf("belma"); } | |
}; | |
int main() { | |
Belma b; | |
Alma& a = b.foo(); | |
a.bar(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment