How can i convert const Byte* to std::string.I tried the following
std::string sTemp(reinterpret_cast<const char*>(ByteBuffer));
Where ByteBuffer is const Byte*.Not got the value of ByteBuffer in sTemp using the above code Please help
Thanks,
If ByteBuffer contains a NUL-terminated string, then the code should work fine.
If it doesn't, you need to supply its length as the second parameter to the string constructor.
The above assumes that Byte is what I think it is, and that ByteBuffer is not NULL.
There's no such data type as 'Byte' in C++. I assume it's a 8-bit data store if at all it exists, in which case your code is correct. Make sure there's a null character - '\0' in the buffer.
Byte? What do you mean by "not got the value"?