fork(3) download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cstdlib>
  4. using namespace std;
  5.  
  6. int main() {
  7. int16_t i = -4;
  8. printf("i = %04x\n", i&0xffff);
  9. cout<<setw(4)<< setfill('0')<<hex<<i<<endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 4304KB
stdin
Standard input is empty
stdout
i = fffc
fffc