The immediate problem is that it needs a #include <sstream>
However, the code you've posted has a rather large number of problems. First, it is a misuse of stringstream, and should really create an ostringstream, push stuff into it, then return the result of str(). Second, the string argument should be declared const reference, it's an idiom for complex types to avoid copy construction. It should also assert() that the number of items in the vector is greater than 0 and that numPerLine is greater than or equal to 0.
But the most important question is.. Why can't you use std::vector?
|