My code compiles fine, but when it comes to running it, it crashes. As soon as i input line 11 it makes the .exe program crash when it stats up. I have no idea what it is so i was wondering if someone on here could lend me a hand.
int enemyStats(vector<int>&ENEMY_STATS,vector<int>PLAYER_STATS,vector<string>stats){
ENEMY_STATS[1]=PLAYER_STATS[1];
vector<int>::iterator iter;
srand(time(0));
int Stats=rand()%100+1;
ENEMY_STATS[0]=Stats;
int points=ENEMY_STATS[1]*40;
for(iter=ENEMY_STATS.begin();iter!=ENEMY_STATS.end();++iter){
Stats=rand()%points+1;
*iter=Stats;
points-=Stats; //just here
}
vector<int>::iterator inIter;
vector<string>::const_iterator stIter;
stIter=stats.begin();
for(inIter=ENEMY_STATS.begin();inIter!=ENEMY_STATS.end();++inIter){
cout<<*stIter++<<"\t";
cout<<*inIter<<endl;
}
}
Thanks for all the help people on here have been giving me recently.
Just in case it helps im using windows seven 64-bit, code blocks 13.12 any other info that is needed just comment.