I am trying to get this code working:
#include <iostream>
void reset_2D_dbl_array(double **p, int nrows, int ncols);
int main(){
double big_matrix[10][10];
reset_2D_dbl_array(big_matrix,10,10);
std::cout << big_matrix[0][0];
std::cin.ignore();
return 0;
}
void reset_2D_dbl_array(double **p, int nrows, int ncols){
int n = nrows * ncols;
while(n-- > 0){
**p++ = 0.0;
}
}
I don't understand why isn't it working.
I took the code from the new book "C++ for the impatient" and it still doesn't work..
I want to use two "at" signs in the function when changing the value's without index's and square brackets.
EDIT: please look at the second comment of mine for more information, thanks :)
EDIT2: pasted the wrong code :)