
15 Oct
2005
15 Oct
'05
12:46 a.m.
Hi! Library version 1.33.0. The input string contains null characters. I want to use null character as the seperator. The following code produces only "X". Why "Y" and "Z" are discarded and how to fix this code? ========= #include<iostream> #include<boost/tokenizer.hpp> int main(int argc, char* argv[]) { using namespace std; using namespace boost; string str="X\0Y\0Z"; typedef tokenizer<boost::char_separator<char> > Tok; char_separator<char> sep("\0"); Tok tokens(str, sep); for(Tok::iterator tok_iter = tokens.begin();tok_iter != tokens.end(); ++tok_iter) cout << *tok_iter; return EXIT_SUCCESS; } ========= Thank you in advance! CN -- http://www.fastmail.fm - Access your email from home and the web