C++ better way to parse values into a vector
===

I am parsing an array of text that come from "C-only" interface and where each string may have an arbitrary amount of values that may, isolatedly, be parsed by a "`istream::operator >>()`".

For example, one of the parsers is for a custom IPv4 class:

    std::istream &	operator >>( std::istream& stream, IPv4 &var )

The implementation is quite obvious.


Now suppose an input like:

    const char *string_array[] =
    {
        "192.168.0.1, 192.168.0.32,    192.168.0.40",
        "169.254.3.18, 169.254.3.19, 169.254.3.20, 169.254.3.21",
        "10.0.92.100",
        "10.0.0.101,    10.0.0.102,    10.0.0.103   ,  10.0.0.104 , 10.0.0.110  ",
    };

I'd like to find an elegant way to put all of the parsed values in an array so that I can send it to "C-only" functions.

The naive way would be first contatening all of the strings (`const char *`) with a `stringstream` and then loop over this stream with my `operator >>`.


 			std::stringstream	ss;
 			IPv4 ip;
 			std::vector< IPv4 > ip_vector;

			 for ( int c = 0; c < count; ++c )
 							ss << string_array[ c ];

			 while ( ss.good( ) )
			 {
 							ss >> ip;
 			 			ip_vector.push_back( ip );
			 }


It seems not that wise to me, but I can't figure out how to make this smarter.

Could anyone please help me with ideas?

** NOTE: It is to be run on a somewhat limited embedded device that can't count with BOOST. **

Thanks!
