Show ASCII table: Difference between revisions
→{{header|C++}}: Removed defines
(→{{header|C++}}: Removed defines) |
|||
Line 1,565:
#include <iostream>
inline constexpr auto HEIGHT = 16;
inline constexpr auto ASCII_START = 32;
// ASCII special characters
inline constexpr auto SPACE = 32;
inline constexpr auto DELETE = 127;
std::string displayAscii(
switch (ascii) {
case SPACE: return "Spc";
case DELETE: return "
▲ return std::string(1,char(ascii));
}
int main(
for (std::size_t row = 0; row < HEIGHT; ++row) {
for (
std::cout << std::right << std::setw(3) << ascii << " : "
}
▲ std::cout << std::right << std::setw(3) << ascii << " : " \
}
}</syntaxhighlight>
{{out}}
|