I am now writing my master thesis in computer science and the assignment is to program a small part of a bigger project. For this i need use a map::find to find out if a element is equal to something and based on that take action. When compiling it all goes well, but at runtime it gives a segmentation fault. The problem is I cannot see the error in my code, and have the last few hours stared myself blind on it. Any help would be appreciated.
if(tag.m_vecAttribute.size() > 0);
{
KBAttrTable* pAttrTable;
map<string, KBAttrTable*>::iterator it;
it = m_mapstrpTagTable.find(tag.m_strTagName);
if(it == m_mapstrpTagTable.end())
{
Do something
}
else
{
Do something else
}
for(int i=0; i< tag.m_vecAttribute.size(); i++)
{
Do something with the map
}
}
I have localized the segmentation fault to the "it = m_mapstrpTagTable.find(tag.m_strTagName);" line but I cannot for my life see any errors in it.
Thanks in advance guys.

Ask A New Question
Reply





MultiQuote





|