I have a function that expects a uint8 * representing a buffer and an int representing the buffer length. How should I go about transforming a std::string into a uint8 * representing the string? I have tried using c_str() to transform it into a char * but I still can't convert to uint8 *.
The function signature looks like.
InputBuffer(const UINT8* buf, int len, bool usesVarLengthStreams = true)
and I am trying to do the following
string ns = "new value";
int len = 10;
UINT8 * cbuff = ns; //(UINT8 *) ns.c_str(); doesn't work
in = new InputBuffer(cbuff, len);