i would like to test if a value of an input variable passed one byte size or know so i write this code
{
uint8_t x;
cout << " enter x" << endl;
cin >> hex >> x;
cout << hex << x;
uint8_t y ;
y = x >> 4 ;
cout << hex << y;
if ( y == 0 )
{
cout << " succes, coorect value for x";
}
if (y > 0)
{
/*here i supoosed that x = 0xfff and when shifting, y would be 0xff but y is uint8 so it's just for compare
std::cout << "fail, ";
}
return 0;
}
I would like to know how to test if the user type two or more byte in uint8. And tell him to retype the value of just one byte.that's why i tried to compare uint8_t to uint16_t.