NULL In a Class Destructor
- by Hyper-DarkStar
Simple question; 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?
Thanks.