If the current protocol is satisfactory for you, so be it. You might also be able to accomplish essentially the same thing by processing each number as you read it in, rather than read in all the numbers at once and parse the whole file/string. To do that, I'd use getline() with comma as the delimiting character to read a string representing a single number into a buffer and convert the buffer on the fly. This approach might work better if you don't know the number of numbers or the number of digits in the numbers you're going to need to hold the composite string and you aren't hardcoding the string but reading it on the fly.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005