How to get stringstream to treat uint8_t as a number not a character?
stringstream
Solution
If you are using std::stringstream in order to convert uint8_t to string, then you can use std::to_string instead. Allowed in c++11 only.
C++11 Feature
#include <stdint.h>
#include <iostream>
uint8_t value = 7;
std::cout << std::to_string(value) << std::endl;
// Output is "7"
Problem
I have this code and wondering if it's possible to have stringstream to treat uint8_t as a number not a character? ``` uint8_t s; std::stringstream sstream( "255" ); sstream >> s; std::cout << s << " equals 50/'2' not 255 " << std::endl; ``` s should be 255 not 50/'2'