Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

erase method on map causes memory access violation

Status
Not open for further replies.

ARCITS

Programmer
Apr 4, 2002
99
GB
I am trying to use the erase method on a map as follows:
map <int,loan*> loanMap;
map <int,loan*>::iterator loanit;
for (loanit=loanMap.begin();loanit != loanMap.end();loanit++)
{
if ((*loanit).first==access)

{
loanMap.erase(access);
}

}
The loanMap.erase(access) code causes a memory access violation.
Please can you help?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top