title: casting elements of uint8 vector to stringstream
body: <p>I'm havig some trouble figuring out how to conver my uint8 vector to stringstream.</p>
  
  <p>On input im getting vector of uint8, first 9 bytes are flags which i dont need in my string stream, next 2 bytes are some data i need as string, let's call them "name1", next 2 bytes are another name, lest call it "name2", then comes 4 bytes which are some uint32 number(but writen as 4 uint8 bytes), lets call it just "number". Now i need to pass these data to stringstream but:</p>
  
  <ul>
  <li>name1 and number2 need to be written as bytes (byte 0x52 -> char[2]={"5","2"}) </li>
  <li>number needs to be casted to uint32</li>
  <li>all variables need to be seperated by semicolons in final stringstream</li>
  </ul>
  
  <p>so if im getting a vector like this one:</p>
  
  <p>---some 9 bytes---, 0x05, 0x00, 0x01,0x00,0x00,0x00,0x08,0x0E, ---some other data---</p>
  
  <p>i need stringstream to be like this:</p>
  
  <p>"0500;0100;2062;"</p>
  
  <p>i have managed to figure out how to cast number to uint32:</p>
  
  <pre><code>uint8_t tab[4];
  for(int i=4; i!=0; --i)
  {
      tab[4-i]=data[i+14];
  }
  uint32_t* var = (uint32_t*)tab;
  </code></pre>
  
  <p>is there some better way to do this?</p>
  
  <p>EDIT:</p>
  
  <p>How can i pass uint8 values to string as characters?</p>
  
  <p>example:</p>
  
  <p>byte ouput: 0x05</p>
  
  <p>string output: 05</p>
  
  <p>can i put string to stringstream using "&lt;&lt;" operator or is it not recommended?</p>