I'm trying to make a simple game engine. I've never used OOP before, so this is probably a simple mistake, but I get this error when trying to create an instance of a class.
invalid conversion from `World*' to `int'
initializing argument 1 of `World::World(int)'
This is the code to create the class.
World w = new World(100);
And the actual class:
class World {
int maxParts;
public:
GameObject **parts;
World(int maxParts);
int addObject(int type);
private:
int firstFreeId();
};
World::World(int maxParts)
{
parts = new GameObject *[maxParts];
}
...
Thanks for any help.