for (int aa = 0;aa<8;aa++)
bunnies.push_back(bunny(0,0)) ; //push back a default constructed bunny.
bunny &workingBunny = bunnies.back() ;//i have lost track of how to use //reference like this
brdray [workingBunny.getposx()][workingBunny.getposy()] = (workingBunny.getsex());
while (1)//this poor practice is temporary
for (int cc=0;cc<bunnies.size();cc++)
brdray [(bunnies[cc].getposx())][(bunnies[cc].getposy())] = bunnies[cc].getsex();
//i tried 'bunnies.erase(bunnies[cc])', i think i lost rack on how this //code works too
erase takes an iterator as argument. To convert the index to an iterator you can add the index and the iterator to the first element in the vector. bunnies.erase(bunnies.begin() + cc);
This will make all the bunnies that is stored after the erased element to be moved one step so that their index is reduced by one. If you go on and do cc++ you will miss one bunny so you probably only want to do cc++ if a bunny was not erased.