Here is the code. When
is changed toCode:string line("dd-9c32d00@3");
The program crashes.Code:string line("dd-9c32d00");
It seems that tok.end() does not bound the end of string parsing?
Code:#include <boost/tokenizer.hpp> using namespace std; using namespace boost; int main(){ //string line("dd-9c32d00@3"); string line("dd-9c32d00");// crashes! typedef boost::tokenizer< boost::char_separator<char> > token; boost::char_separator<char> sep("@"); token tok(line, sep); token::iterator itt=tok.begin(); if (itt==tok.end()) cout<<*itt; else cout<<*(++itt); return 0; }



LinkBack URL
About LinkBacks


