I have 1 compiler error. It is from this line in my code:
cout << myClass->Get_Type().description;
Where as Get_Type() is:
void Tile::Get_Type() {
return &myStruct;
}
I’m not quite sure what I am doing wrong. Or what for that matter could be going wrong.
A function with a return type of
voidcannot return anything (that’s what thevoidmeans: the function does not return anything). You are trying to return something (the address ofmyStruct).You either need to return nothing (i.e. change your return to just be
return;or remove it entirely) or change the return type of the function fromvoidto a pointer to whatever the type ofmyStructis.