Possible Duplicate:
Is it worth setting pointers to NULL in a destructor?
Is it pointless to set a pointer (which allocates heap memory) to NULL
in the destructor?
class SampleClass
{
public:
SampleClass( int Init = 0 )
{
Value = new int( Init );
}
~SampleClass( void )
{
delete Value;
Value = NULL; // Is this pointless?
}
int *Value;
};
While on the subject of classes, when should I use the explicit
keyword?