+ 1
What does **table signifies
char *str can be used to save a string. int *x can be used to access array. so what does this int **table signifies.
1 Réponse
+ 4
it will create an array of pointers where each pointer points to another array
two dimensional array, or in another more appropriate term: a table
of course you have to dynamically allocate that space to use it.
ex.
int main(){
int **table;
table = new int[3]; // create an array of 3 pointers
for(int i=0;i<3;i++){
table[i] = new int[4];
}
}
now you have a table with 12 cells to hold integer values
0 1 2 3
0 [ ] [ ] [ ] [ ]
1 [ ] [ ] [ ] [ ]
2 [ ] [ ] [ ] [ ]