Thomas <[EMAIL PROTECTED]> writes:

> What is the correct way for me to call delete?

    for (int x=0; x < m_iWidth; x++)
        delete [] m_pcPuzzle[x];
    delete [] m_pcPuzzle;

> Am I allocating the memory correctly?

Yes, assuming you want to use x[i][j] syntax to access it.

However, since you are coding in C++ there are more efficient (and
less error-prone) ways to implement this, while still preserving the
"double index" syntax. 

Think "class Puzzle { char *operator[](int); ...};"

Oh, and I drop that horrible Hungarian naming convention, would
you ... 

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to