removing the two asterisks from when I call the function gives me the error: line 15; invalid conversion from 'int**' to 'int'.
Adding to asterisks to the declaration gives me a simililar error: line 15; invalid conversion from 'int' to 'int**'.
This is the main function:
Code:
int main()
{
int width, height;
cout << "Please enter the width followed by the height of the table: ";
cin >> width >> height;
createTable(width, height);
printTable(**p_p_table, width, height);
return 0;
}
Here is the function:
Code:
void printTable(int **p_p_table, int width, int height)
{
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
cout << p_p_table [i][j] << " ";
}
cout << "\n";
}
}
Here is the declarations:
Code:
using namespace std;
void printTable (int **p_p_table, int width, int height);
void createTable (int width, int height);
int **p_p_table;