what i am trying to do is this: NeoGenesis::CNeoObject m_Obj = new NeoGenesis::CNeoObject(); this compiles with error: error C2440: 'initializing' : cannot convert from 'NeoGenesis::CNeoObject *' to 'NeoGenesis::CNeoObject' c:\Users\Almighty\Documents\Visual Studio 2005\Projects\NeoGenesis\NeoGenesis\NeoGenesis.cpp the thing I do not want the m_Obj to be a pointer. the current new override is written as follows. void* CNeoObject:perator new(size_t nSize) { return malloc(nSize); } how do I go about doing this?
NeoGenesis::CNeoObject m_Obj = new NeoGenesis::CNeoObject(); should be in C++ as NeoGenesis::CNeoObject *m_Obj = new NeoGenesis::CNeoObject(); because pointers in C++ are defined with *
well I am at some point will have a game engine built from the ground up. I am not interested in takeing a existing game engine and doing my thing I want to build one and re-inforce what I know with c++ and how it is done. yes I eventually just might make a game but I want to start at the gorund level with an object then move that object into a collection list<ResourceManager template> and progress write on down the line. I may have mixed up c++ and C# in the initial getting started. as soon as I get the collections working I plan to move on to a memorypool manager and so forth. I am also a student and this will cover everything I need to know. data structures, algorythms, memory management and so forth. Kenneth
You don't have to instantiate objects on the heap. If you do, they'll be referenced by pointers. Consider this: mission critical or life support systems don't use the heap in any important way (if at all). What if you asked for memory and didn't get it?