Raspuns: Nu se intampla nimic.
NOTA: Teste gen
Code: Select all
if(p != 0)
{
delete p;
}
Standardul de C++ spune urmatoarele:
Deci, testul de NULL dinaintea lui delete, nu are rost....if the value of the operand of delete is the null pointer the operation has no effect.
Resurse
- ISO/IEC 14882:2003 - 5.3.5 Delete
Next FAQ >>