Created
April 26, 2018 07:13
-
-
Save emirozturk/8b29c7bbba737263c7ac870eadd05d44 to your computer and use it in GitHub Desktop.
Multiple Interitance and diamond problem
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 temel { | |
public: | |
temel() { | |
cout << "temel" << endl; | |
} | |
~temel() { | |
cout << "temel yikici" << endl; | |
} | |
void calis() { | |
cout << "temel calisti" << endl; | |
} | |
}; | |
class A : public temel { | |
public: | |
A() { | |
cout << "A" << endl; | |
} | |
~A() { | |
cout << "A yikici" << endl; | |
} | |
}; | |
class B : public temel { | |
public: | |
B() { | |
cout << "B" << endl; | |
} | |
~B() { | |
cout << "B yikici" << endl; | |
} | |
}; | |
class C : public B, public A { //Yer değiştirince değişir mi? | |
public: | |
C() { | |
cout << "C" << endl; | |
} | |
~C() { | |
cout << "C yikici" << endl; | |
} | |
}; | |
//int main() | |
//{ | |
// C yeni; | |
// yeni.calis(); | |
// return 0; | |
//} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment