double** A = NULL; //Pointer to rows of A Matrix (NxN, type double)
//Allocate space for pointers to rows of A matrix
if (!(A = new double*[N])){
cout << “Allocation for A failed. \n”;
return 0;
} //End if
// Allocate space for entries of the columns of the A Matrix
for (i = 0; i < N; i++) {
if (!(A[i] = new double[N])){//If failure, release memory allocated before ending program
for (j = (i – 1); j >= 0; j–)
delete [] A[j];
delete [] A;
cout << “Allocation for columns of A failed.\n”;
return 0;
} //End if !A
}//End for i