Skip to main content
gamedev.net
🔒 Locked

Dynamic object allocation

Started by Joe Forhens Jan 4, 2003 at 1:08 PM 10 replies 250+ views
Original Post
Joe Forhens
Joe Forhens
Here's what i tried : (Player is a class) Player *Players; Players = new Player[NumOfPlayers]; VC++ gives me assertion failure , any ideas ? [edited by - Joe Forhens on January 4, 2003 2:26:32 PM]
Thank you all :)
civguy
civguy
It''s a class, not a "class object".

Maybe Player constructor does something illegal, since it''s being executed NumOfPlayers times.
Joe Forhens
Joe Forhens
mmm.. constructor does nothing at the moment
Thank you all :)
dannybr
dannybr
is NumOfPlayers defined correctly ?
..::d::..
ga
ga
maybe NumOfPlayers is a very high number, check its value
Visit our homepage: www.rarebyte.de.stGA
Joe Forhens
Joe Forhens
NumOfPlayer Is a small value .
I get a "Visual c++ debug library , debug assertion failed .
expression _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)"
Are there any restrictions when allocating objects dynamically ?


[edited by - Joe Forhens on January 4, 2003 3:24:13 PM]
Thank you all :)
civguy
civguy
Anyway, those two lines (that should really be written as one line) you''ve given aren''t really the ones to blame unless NumOfPlayers is negative (could it be?) or Player constructor does bad things (which it doesn''t). Post more code, I''m done with quessing
Joe Forhens
Joe Forhens
Lol , i fixed the prob guys Don't ask me what the prob was :D , it's funny

[edited by - Joe Forhens on January 4, 2003 4:06:19 PM]
Thank you all :)
civguy
civguy
I''m asking anyway: What was it?
Qw3r7yU10p!
Qw3r7yU10p!
share all things with your teachers

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.