Hello everyone, please help with the task. Condition: Write a program that displays the first part of the character encoding table (characters with codes from 0 to 127). The table should consist of eight columns and sixteen lines. The first column should contain symbols with a code from 0 to 15, in the second - from 16 to 31, etc. Here is the code:
#include <iostream> using namespace std; int main() { int i, j, m, n; cout << "Stroki : "; cin >> m; cout << "Stolbci : "; cin >> n; cout << "ASCII\n"; char** table = new char* [m]; for (i = 0; i < m; i++) { table[i] = new char[n]; for (j = 0; j < n; j++) { table[i][j] = (n*i + j); cout << table[i][j]; } cout << endl; } return 0; }
But it displays only ASCII characters , but I need to display characters with codes from 0 to 127.
isprint
. In general, the task is trivial, why do you need an intermediate table? - VladD