std::stringstream oss; for(unsigned int i=0;i < buffer->size();i++){ oss<<(*buffer)[i]; } string temp=oss.str(); const char * buf=temp.c_str();