variable scope when adding a value to a vector in class constructor
- by TheFuzz
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?