These are some seriously great replies! This board rocks! Here are a few additional comments:
Micko:
Your code is somewhat confusing but I like your method a lot... just one allocation and we...
Type: Posts; User: cppboard05
These are some seriously great replies! This board rocks! Here are a few additional comments:
Micko:
Your code is somewhat confusing but I like your method a lot... just one allocation and we...
Ok, I tested it... seems to work great :D
But what about efficiency? It seems to me this is the same thing I was doing initially but with a better syntax, which probably means the overhead and...
Thanks for the correction... one memory leak less :)
[QUOTE]
Another why using vectors:
void createMatrix(int size)
{
vector< vector<double> > M;
M.resize(size);
...
Thanks for the reply... does anybody else know if the right way of dynamically creating a n*n array is:
double **M = new double*[size];
for (int k = 0; k < size; k++)
M[k] = new...
Hi,
I'm trying to dynamically create a matrix, let's call it M, which can be accesed using the usual M[i][j] notation. That's it, it should behave as if I had declared it as a double M[5][5],...