I want to implement the following have a character buffer and the code I am trying to port puts this character buffer in a stream and then does a get like this
char *buffer; //this is initialized
int bufferSize; //this is initlized
std::istringstream inputStream (std::string(buffer, bufferSize));
int getVal = inputStream.get();
EDIT: Is the above code optimal, wherein for getVal you copy the entire buffer to a stream and then do a get on the stream.
How can I get the getVal value from the buffer itself.