Suppose I have a really complicated buffer scrambling function that does something with the following prototype:
void do_something(char * thebuffer, int thelength);
And suppose I need to get the function working on an std::string. But std::string.c_str() returns const char*, which is not mutable.
Besides making a new char* buffer, and passing it to do_something, is it possible to use do_something for an std::string?
My situation is actually currently the other way around (a char *, int into a std::string& taking function).
Or is the only way to go around this, is to go make a new copy of the function, which does the same thing? (which doesn't really scream good style)