Created
December 10, 2011 14:51
-
-
Save fpersson/1455335 to your computer and use it in GitHub Desktop.
Circular depediance
This file contains hidden or 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> | |
class Barney; | |
class Fred{ | |
public: | |
void tada(){ | |
std::cout << "tada" << std::endl; | |
} | |
private: | |
Barney* y; | |
}; | |
class Barney{ | |
public: | |
void method(){ | |
x->tada(); | |
} | |
private: | |
Fred* x; | |
}; | |
int main(){ | |
Barney b; | |
b.method(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment