fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string test(1, 0xfe);
  7. long num = (unsigned char)test.at(0);
  8. cout << num << endl;
  9. return 0;
  10. }
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
254