variable scope when adding a value to a vector in class constructor

Posted by TheFuzz on Stack Overflow See other posts from Stack Overflow or by TheFuzz
Published on 2010-05-07T23:27:12Z Indexed on 2010/05/07 23:38 UTC
Read the original article Hit count: 157

Filed under:
|
|
|

I have a level class and a Enemy_control class that is based off an vector that takes in Enemys as values. in my level constructor I have:

Enemy tmp( 1200 );
enemys.Add_enemy( tmp ); // this adds tmp to the vector in Enemy_control

enemys being a variable of type Enemy_control. My program crashes after these statements complaining about some destructor problem in level and enemy_control and enemy.

Any ideas?

© Stack Overflow or respective owner

Related posts about c++

Related posts about contructor