This looks good too!
Did you mean to make the ID a byte instead of a dword in the CGamePieceMgr and for m_dwNumObjects in CGamePieceMgr?
Type: Posts; User: Potterd64
This looks good too!
Did you mean to make the ID a byte instead of a dword in the CGamePieceMgr and for m_dwNumObjects in CGamePieceMgr?
That example had a typo. I think my code had the same typo though :-/. Either that or I'm not deleting properly and have a bunch of leaked memory. Thanks for your help.
Thats a good idea, I'll probably do something like that.
Shouldn't this still work though?
SomeObject *s = new SomeObject();
for(int i=0; i < 8; i++){
for (int j=0; j < 8; j++){
arr[i][j]...
I actually just planned on initializing it to have every spot point to the same object. This object is a special game piece that represents a spot with no game piece. Later when I put pieces on the...
psycopath, I thought that would work, but my program crashes when I do that.
Bubba, I'm new to c++ and didn't think a 2d array of pointers would be challenging. I thought that the best way to...
that works, but doesn't it still create 64 new objects? Can I have all my array slots point to one object?
Also now I have a problem calling member functions. For instance arr[x][y]->getChar()...
wont that create 64 separate objects? I'd rather have each spot point to one object.
I have a 2d array of object pointers. It looks like this.
someObject *arr[8][8];
This arr array is a member of another class. I tried initializing it in a double for loop by pointing all of...
Hi all,
I have a vector of pointers to objects called GamePiece
I'm using an iterator to go through them like this...
vector<GamePiece*> v = p1->getPieces();
for...
I'm new to C++ and I"m not sure how to work my way around this problem.
I have a function that takes another function as its argument
function(void (*)(...))
I'd like the function that I'm...