I\'ve been wondering about the following issue: assume I have a C style function that reads raw data into a buffer
int recv_n(int handle, void* buf, size_t l
Why not use a vector instead of a string? That way you can do:
vector
string
vector v(100, '\0'); recv_n(handle, &v[0], 100);
This seems more idiomatic to me, especially since you aren't using it as a string (you say it's raw data).