Because int8_t
is the same as signed char
, and char
is not treated as a number by the stream. Cast into e.g. int16_t
std::cout << static_cast<int16_t>(value) << std::endl;
and you’ll get the correct result.
More Related Contents:
- No error/warning for multiple cout in one statement
- How do I print out the contents of a vector?
- How to print Unicode character in C++?
- Can I set a breakpoint on ‘memory access’ in GDB?
- Debugging core files generated on a Customer’s box
- cout not printing unsigned char
- Error “undefined reference to ‘std::cout'”
- how do I print an unsigned char as hex in c++ using ostream?
- std::cout won’t print
- mixing cout and printf for faster output
- C++ cout hex values?
- Why I cannot cout a string?
- Floating point format for std::ostream
- How do I print the elements of a C++ vector in GDB?
- Inspecting standard container (std::map) contents with gdb
- Run an Application in GDB Until an Exception Occurs
- How to cout a float number with n decimal places [duplicate]
- How do I print the full value of a long string in gdb?
- Get function names from call stack
- Stopping the debugger when a NaN floating point number is produced
- When does cout flush?
- Unbuffered output with cout
- traceback a pointer in c++ code gdb
- Why “cout” works weird for “unsigned char”?
- “please check gdb is codesigned – see taskgated(8)” – How to get gdb installed with homebrew code signed?
- calling operator
- Is it possible to set a gdb watchpoint programmatically?
- “cout” and “char address” [duplicate]
- How to avoid entering library’s source files while debugging in Qt Creator with gdb?
- Remote debugging C++ applications with Eclipse CDT/RSE/RDT