hi,
int** matrix = new int* [b];
int** matrix is pointer which point ot another pointer(s)
= new int*[b]; alocate an array of pointers to int (where b will indicate how many pointers to int will be in that array.
**matrix will point to the first *pointer in that matrix...
furter when you indexiing matrx you rach desired *pointer:
matrix[3]; is 3th pointer in that array where this third pointer points to an int.
to enter some value in that int, so you must reach that value using "last pointing pointer" for example:
matrix[3][4] = 4;
is something like
matrix->fourthPointer = 4;
thus if you have:
int****** matrix = new int*****[4]
means that you'll have to initialize all the pointer with pointers and so on until you finaly initialize "last *" (one asterix pointer) which will point to some int, double or whatever..
1 2
|
And why in this line is missing the *?
matrix[x] = new int[a];
|
matrix[x] is final pointer which points an array of ints..
so it does not ned * (which is for pointer only not final variable.
here new int is (unnamed)varialbe wchih you access with pointer to enter some value.
EDIT:
to be more simple to understand:
AN POINTER WHICH POINTS TO ANOTHER POINTER MUST HAVE ONE MORE * ASTERIKS
(this is correct only in pointer to new pointer)
cherrs!