Hi got this message which I need help with:
Severity Code Description Project File Line Suppression State Warning C4302 'reinterpret_cast': truncation from 'const _Elem *' to 'unsigned char' row 94
Severity Code Description Project File Line Suppression State Warning C4302 'reinterpret_cast': truncation from 'const _Elem *' to 'unsigned char' row 95
uint16_t Id = 325;
std::stringstream stream;
stream << std::setfill('0') << std::setw(4) << std::hex << Id; //Result: 0145
std::string str1 = stream.str().substr(0, 2); //Result: 01
std::string str2 = stream.str().substr(2, 2); //Result: 45
unsigned char char1 = reinterpret_cast<unsigned char>(("0x" + str1).c_str()); //Wanted result: 0x01
unsigned char char2 = reinterpret_cast<unsigned char>(("0x" + str1).c_str()); //Wanted result: 0x45
unsigned char Mac[6] = { 0x00, 0x1D, 0xE2, 0x03, char1, char2 };