C ++ is really handy on most projects, but sometimes you just need to integrate with existing C style features.
How do you do this carefully, especially if you work with strings?
I had the idea that I can use the construct as follows:
std::string buffer;
buffer.resize(1024);
GetBackCStyleString(&buffer[0], 1024);
But this causes problems with the length of the string, as it returns the changed length. Is there a better way to integrate C functions into C ++ code?
Coder source
share