wrote:
> I'm trying to create a program that will buffer data received in UDP
> packets.
>
> I'd like to use an STL object that will allow me to add on new data
> like this:
>
> buffer+=newdata;
>
> I don't think I can use a string because I don't think it allows 0
> characters.
>
> Any ideas on what to use?
>
1. Yes, std::string allows 0 characters.
2. You should probably use a std::vector<unsigned char>, though, since
you may not receive string data.
3. std::copy(newdata.begin(),
newdata.end(),
std::back_inserter(buffer));