I could use some help with this one. I don't really know where to begin. This is my first programing book, and I've only read up to this chapter, and I didn't do very well with the last chapter (CH 13) either, but I completed most of the practice problems in chapter 13. I need help with the two dimensional arrays. I don't really know how to put them into a function, either.
The code I've got seems like it should work, but it freezes when I try to run it. I'm working in Xcode. Here is my code so far.
Code:
#include <iostream>
usingnamespacestd;
void multiplicationTable (int numbers) {
cout << numbers;
}
int main() {
int **p_p_numbers;
p_p_numbers = new int*[3];//(myarray);
for (int i = 0; i < 3; i++) {
p_p_numbers[i] = new int[3];
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
p_p_numbers[i][j] = 0;
}
}
//print out the array
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
multiplicationTable(p_p_numbers[i][j]);
}
}
for (int i = 0; i < 3; i++) {
delete [] p_p_numbers[i];
}
delete [] p_p_numbers;
}