//obj1
class obj1{
obj1();
void foo();
.......
};
// file1.cpp
int main{
...
obj1 Ob;
.....
}
//file2
class obj2{
obj2();
.......
};
//file3
class obj3{
obj3();
.........
};
my question is, how can i access the instance 'Ob' in the main.cpp from the constructor of ther classes without instancing them in the main file. Something like that:
1 2 3 4 5 6 7 8
class obj3{
obj3();
.........
};
obj3::obj3(){
Ob.foo(); // how can i implement it
}