|
-
June 7th, 2002, 01:43 PM
#1
STL Problem
Can anyone tell me why example A works and example B throws an exception?
vTempContents is a vector<string>. m_strItr is an iterator. m_strMarker is a string. m_fGlossOut is an ofstream object.
Example A
m_strItr = vTempContents.begin();
while (m_strItr != vTempContents.end()) {
if(m_strItr != m_strMarker) {
m_fGlossOut.write(m_strItr->c_str(), m_strItr->size());
}
m_strItr++;
}
Example B
m_strItr = vTempContents.begin();
while (m_strItr != m_strMarker) {
if (m_strItr != vTempContents.end()) {
m_fGlossOut.write(m_strItr->c_str(), m_strItr->size());
}
m_strItr++;
}
Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|