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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hmmmmm.?

Status
Not open for further replies.

jstreich

Programmer
Joined
Apr 20, 2002
Messages
1,067
Location
US
I have code that looks like the following, (it's going to be changing soon
so as not to use the list), but for some reason the assert is failing the
assertion on the first iteration of the loop. misspell takes a string and
the dictionary miss (does not know about the list), how can it fail the
assertion???

Code:
  int i = 0;
  for(list<string>::iterator iter = l.begin(); iter != l.end(); ++iter){
    cout << i++ <<endl;
    cout << &quot;Starting to mispell &quot; << *iter << &quot; Please watch...&quot;<<endl;
    load.misspell(*iter,miss);
    assert(iter == l.begin());
  }
 
What about the loop with commented
Code:
load.misspell
line? At 1st sight misspell(string...) can't touch your list or iterator, but...
My test run (w/o load..., of course) was OK...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top