Hello,
Just curious as to whether or not I've implemented this code correctly.
Thank YouCode:// Rafael Negron // 7.20.2014 /* Write a function that builds a two-dimensional multiplication table with arbitrary sizes for the two dimensions. */ #include <iostream> using namespace std; void multiplication_table(int size) { int **p_p_table; p_p_table = new int*[size]; for (int i = 0; i < size; i++) { p_p_table[i] = new int[size]; } for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { p_p_table[i][j] = i * size; } } for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { cout << "[ " << i << " ] [ " << j << " ] = "; cout << p_p_table[i][j]; cout << "\n"; } } for (int i = 0; i < size; i++) { delete[] p_p_table[i]; } delete[] p_p_table; } int main() { int size; cout << "Enter: "; cin >> size; multiplication_table(size); cin.ignore(); cin.get(); }