Basic string tokenizer in C++