Witam, czy może ktoś mi wytłumaczyć dlaczego program nie wyświetla tablicy?
#include <iostream>
using namespace std;
int main() {
int x, y;
cout << "Podaj liczbe wierszy" << endl;
cin >> x;
cout << "Podaj liczbe kolumn" << endl;
cin >> y;
int **tab = new int*[x];
for (int i = 0; i < x; i++)
tab[i] = new int[y];
for (int i = 0; i < x; i++){
for (int j = 0; j < y; j++){
tab[i][j] = i + j;
}
}
cout << "twoja macierz: " << endl;
for (int i = 0; i < x; i++) {
for (int j = 0; j < y; j++) {
cout << tab[x][y] << endl;
}
cout << endl;
}
for (int i = 0; i < x; i++) {
delete[] tab[i];
}
delete[] tab;
return 0;
}