01-06-2016, 07:59 PM
I will just leave it here...
C++-Code:
#include <iostream> using namespace std; class Root { public: virtual int foo() { return 0; } }; class Mid1 : Root { public: int foo() { return 1; } }; class Mid2 : Root { public: int foo() { return 2; } }; class Top : Mid1, Mid2 //changing order changes output { }; void bar(void* ptr) { Root* root = (Root*)ptr; cout << root->foo(); } int main() { Top* t = new Top(); bar(t); return 0; } |
Ultimately, my constant dissatisfaction with the way things are becomes the driving force behind everything I do.
![[Image: sigline.png]](http://www.lf-empire.de/forum/images/unrealblack/english/sigline.png)
LF2 IDE - Advanced visual data changer featuring instant data loader
LF2 Sprite Sheet Generator - Template based sprite sheet generator based on Gad's method
![[Image: sigline.png]](http://www.lf-empire.de/forum/images/unrealblack/english/sigline.png)
There is no perfect language, but C++ is the worst.
![[Image: sigline.png]](http://www.lf-empire.de/forum/images/unrealblack/english/sigline.png)
LF2 IDE - Advanced visual data changer featuring instant data loader
LF2 Sprite Sheet Generator - Template based sprite sheet generator based on Gad's method
![[Image: sigline.png]](http://www.lf-empire.de/forum/images/unrealblack/english/sigline.png)
There is no perfect language, but C++ is the worst.