hi ppl...
i have a vector of nodes called treenodes...ive just stored a node with the name 'pat' in it...everything else is as defined below:
the vector iterator line causes a runtime error...and Borland points me to string.h saying something about size of string...Code:char word[256]; ifstream in(filename); in >> word; //this has pat in it... //i make a new node with the name pat and push it onto the treenodes vector vector< TreeNode * >::iterator j = find(treenodes.begin(),treenodes.end(),word); cout << (*j)->name;
when i try to do the above by using a for loop it works...
what's wrong with the first one?Code:for(vector< TreeNode * >::iterator j = treenodes.begin(); j != treenodes.end(); j++) { cout << (*j)->name; }
Regards,
Farooq



LinkBack URL
About LinkBacks


