On that topic, stringstream would work just dandy..but it would add some overhead that could easily be dodged by doing something more like what he has described above.