, , char * std::string - , vesrion.c_str().
If you want to copy it to a separate buffer — for the function signature used — the buffer must be allocated before the function is called and must have the same size as version.size () + 1.
Otherwise, you can do the following:
void setVersion ( char** out, std::string in ) {
*out = new char[in.size() + 1];
strcpy ( out, in.c_str() );
}
NTN
source
share