copy elemnt in buffer

a program who copy just length of data which i need for example: data = b\nh\ne\nlength 45\n
i need to copy only 45 in my buffer and then return the rest of my buffer's capacity.

<
1
2
3
4
5
6
7
8
9
10
11
12
vector<uint8_t> buffer(521);
std:.string tmp= "##############__HEADER__\nprotocol-version:0.1\ncontent-length:24\n\n";
   std::string str4= tmp.substr(65,3);// find the position of 24.

   cout<<"\n\n"<< str4 <<endl ;
   std::string::size_type love;

   int i_str4= std::stoi(str4,&love); // convert in integer.

  cout << i_str4<<endl;

   memcpy(buffer.data(), str4,sizeof(char),tmp.size());

>
Last edited on
I have no idea what you ask. Can you explain with more detail?
Topic archived. No new replies allowed.