Miroslav Popov:
Hello,
How to make two classes in a way that each class to have a reference to the other? In general I want to have later these classes in separate files.
The problem is that when I define the classes, the first class doesn't see the second definition.
Not sure if the splitting into files makes it different, but I have been using forward declaration
class Bar;
class Foo {
Bar *MyBar;
...
Thank you Ovo,
It solves the problem. I must have missed it.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
How to make two classes in a way that each class to have a reference to the other? In general I want to have later these classes in separate files.
The problem is that when I define the classes, the first class doesn't see the second definition.