Yu Zhiquan wrote:
for (MyIterator = MyMap.begin(); MyIterator!=MyMap.end(); MyIterator++) { MyMap.erase(MyIterator); }
the moment u call MyMap.erase(MyIterator), the size is reduced and begin() has changed. so in your for loop, MyIterator++ is directing u to the "3rd" element. u should use while loop to delete by check the size, not begin till end. from, -= aLbert =-