Your object of type Class3, obj, does not cause the creation of an object of type Class1. In your code above (although Peter87 shows alternative code), there is no way to call a GetX function of a Class1 object using only an object of type Class3.
Even using Peter87's code, note that you'll still have to make an object of type Class1 and organise its pointer to x.
I'm sorry, my main function wasn't really correct, instead of creating a Class3 object I create a Class1 object. In this Class1 object is a Class2 object and in here is a Class3 object.
I want to be able to call a function from Class1 when I'm working in the Class3 object.
1 2 3 4 5
int main(void)
{
Class1 object;
object->GetX()->GetY()->ExtraFunctionInClass3(); //THIS PART WORKS
}
How to I call the function GetX() from Class1 in ExtraFunctionInClass3()?
I need to do this because I need to be able to edit some variables from Class2.
Is this possible in any way?
@Peter87: Ok I've changed the header includes, thx ;)