A
ADT_CLONE
I am having troubles figuring out how to run a function from a pointer
to a class. Here is the code:
Map *m=Global::Maps[0];
Model *mo=m.getModel(0);
Global::Maps[0] is a pointer to a map and the Maps[] array's type is
*Map.
getModel(index) returns a pointer to a model at index in the *Model
array. Anyway, you can see what I'm trying to do. I'm trying to run a
function using a pointer. Now I know right now my syntax is really
wrong, because address_to_pointer.getModel(0) won't work. Though what I
want to do is make it so that I can do something like this:
Model.getModel(0)
Though how would I dereference the mo pointer to run the function? I've
tried using -> but I get this error:
505 C:\Documents and Settings\Owner\Desktop\Easy
Engine\CodeFile\Input.cpp invalid use of undefined type `struct Map'
By using the way above I get this error:
505 C:\Documents and Settings\Owner\Desktop\Easy
Engine\CodeFile\Input.cpp `getModel' has not been declared
Any help on this problem would be greatly appriciated.
ADT_CLONE
to a class. Here is the code:
Map *m=Global::Maps[0];
Model *mo=m.getModel(0);
Global::Maps[0] is a pointer to a map and the Maps[] array's type is
*Map.
getModel(index) returns a pointer to a model at index in the *Model
array. Anyway, you can see what I'm trying to do. I'm trying to run a
function using a pointer. Now I know right now my syntax is really
wrong, because address_to_pointer.getModel(0) won't work. Though what I
want to do is make it so that I can do something like this:
Model.getModel(0)
Though how would I dereference the mo pointer to run the function? I've
tried using -> but I get this error:
505 C:\Documents and Settings\Owner\Desktop\Easy
Engine\CodeFile\Input.cpp invalid use of undefined type `struct Map'
By using the way above I get this error:
505 C:\Documents and Settings\Owner\Desktop\Easy
Engine\CodeFile\Input.cpp `getModel' has not been declared
Any help on this problem would be greatly appriciated.
ADT_CLONE