I have a string defined as std::string header = "00110033";
now I need the string to hold the byte values of the digits as if its constructed like this
char data_bytes[] = { 0, 0, 1, 1, 0, 0, 3, 3};
std::string header = new std::string(data_bytes, 8).c_str());
I converted the initial string to int array using atoi. Now i'm not sure how to make the string out of it. Let me know if there is any better approach.
newhere?newwithout storing the pointer for a correspondingdelete) to saystd::string header = (new std::string(data_bytes, 8))->c_str();(or whatever it is you meant). You can just saystd::string header(data_bytes, 8);instead.