我在这里要做的是将一个stringbuf
对象转换为一个字符数组。
我这样做是为了将 char 数组发送到C
不理解类型的接口std::stringbuf
。
这是我的代码的一部分来说明问题:
std::stringbuf buffer;
char * data;
//here i fill my buffer with an object
buffer >> Myobject;
//here is the function I want to create but I don't know if it's possible
data = convertToCharArray(buffer);
//here I send my buffer of char to my C interface
sendToCInterface(data);