Mindcraft
03-05-2005, 06:13 PM
im trying to write a function Rm() that deletes the array myArray that was allocated using the "new" operator. If myArray is null, the Rm() function should do NOTHING.
will this work:
Rm
{
if (myArray == null)
// don't know what to put here
else
delete [] myArray;
}
please tell me if this will work. in particular, i am not sure if "myArray == null" is the right way to check if the entire array is null.
will this work:
Rm
{
if (myArray == null)
// don't know what to put here
else
delete [] myArray;
}
please tell me if this will work. in particular, i am not sure if "myArray == null" is the right way to check if the entire array is null.