If I recall, std::string::c_str() returns a const char*. You'll need the const qualifier unless you const_cast it away, but const_cast is almost always a bad idea from what I've seen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include<string>
void* memc0py1(void* _dst, constvoid* _src, size_t _sz);
void* memc0py2(void* _dst, void* _src, size_t _sz);
int main()
{
std::string hello = "Hello";
constchar* cString = hello.c_str();
char* notConst = const_cast<char*>(cString); // <- IDK why the standard allows for it.
void* somePointer;
memc0py1(somePointer, cString, 3);
memc0py2(somePointer, nonConst, 3);
return 0xBADC0DE;
}