11 Jul
2003
11 Jul
'03
00:24
On Friday 11 July 2003 05:12, John Lamb wrote:
Cincai Patron wrote:
void tokenizer(const char line[], const vector<string>& field) {
How did you get this to compile at all? The compiler should have barfed at the first field.push_back() because field is constant.
ops sorry, mistype. Vector field should not be constant.
If you're trying to read a line of data and separate it into tokens, there are some useful functions in iostream or the standard template library. If I recall correctly, something like the following will work
std::copy( std::istream_iteratorstd::string( std::cin ), std::istream_iteratorstd::string(), std::back_inserter( field ) );
I'll try that. Thanks. -- -- Verdi March --