Boost logo

Boost Users :

From: CN (cnliou9_at_[hidden])
Date: 2005-10-14 19:46:20


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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net