Does anyone know how to get a count for a pointer to an array
for example
double** someFnct () {
cout <<"Enter num of row: " <<endl;
cin >> n;
cout <<"Enter num of column: " <<endl;
cin >> m;
double** matrixX = new double[n];
for (int i = 0; i<numOfRows; i++) [
matrixX[i] = new double(m);
}
return matrixX;
}
double** tmpMtrx = someFunct();
int row = sizeof tmpMtrx / sizeof* tmpMtrx; // does not work
int column = // don't even know where to begin with this one
Any insight would be greatly appreciated. Thanks
for example
double** someFnct () {
cout <<"Enter num of row: " <<endl;
cin >> n;
cout <<"Enter num of column: " <<endl;
cin >> m;
double** matrixX = new double[n];
for (int i = 0; i<numOfRows; i++) [
matrixX[i] = new double(m);
}
return matrixX;
}
double** tmpMtrx = someFunct();
int row = sizeof tmpMtrx / sizeof* tmpMtrx; // does not work
int column = // don't even know where to begin with this one
Any insight would be greatly appreciated. Thanks
Comment