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
Yes, after C++11.
But you cant use s.data() as it returns a char const*
s.data()
char const*
Try:
std::string s(100, '\0'); recv_n(handle, &s[0], 100);
Depending on situation, I may have chosen a std::vector especially for raw data (though it would all depend on usage of the data in your application).