int main()
{
std::int8_t myInt{};
std::cin >> myInt;
std::cout << myInt;
}
This will also read a character, and
print the characters ascii value.
So if I give it 35, it read it only first '3', and prints out 51.
The g++ 13.2 compiler gives also no warning of this whatsoever with the flags:
"-std=c++20",
"-pedantic-errors",
"-Wall",
"-Wpedantic",
"-Wshadow",
"-Wcast-align",
"-Wlogical-op",
"-Wno-unused-parameter",
"-Weffc++",
"-Wextra",
"-Wconversion",
"-Wsign-conversion".
It does seem like a mistake to have `signed char` and `unsigned char` display as characters rather than numbers, since `char` is a distinct type. And so `char` could display as a character and the other two as integers.
Wish you can change this, or at least have a warning, because <iostream> functions fine for higher bitted integers.
Thanks.
OE