Do i require checking for null before delete p?, C/C++ Programming

No. it's not required

The C++ language guarantees that delete p will do nothing if p is equivalent to NULL. As you might get the test backwards, and as most testing methodologies force you for performs test explicitly every branch point, you should not put in the redundant if test.

Wrong:                    

if (p != NULL)

delete p; Right: delete p;

 

Posted Date: 3/19/2013 8:40:07 AM | Location : United States







Related Discussions:- Do i require checking for null before delete p?, Assignment Help, Ask Question on Do i require checking for null before delete p?, Get Answer, Expert's Help, Do i require checking for null before delete p? Discussions

Write discussion on Do i require checking for null before delete p?
Your posts are moderated
Related Questions
What are Arrays? Numerous applications require the processing of multiple data items that have identical characteristics. In such circumstances it is frequently convenient to p

Conversion Functions Conversion functions are member functions used for the following purposes: 1. Conversion of object to basic data type. 2. Conversion of basic data ty

Explain the parts of operators Assignment Operators The equal (=) sign is used for assigning a value to another. The left hand side has to be a variable (lvalue, which exc


what is the syntax to get a coloured output.


What is the specialty in sizeof() operator

Ask question #Minimum 100Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the followi

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Hello, I would like to know if you can help in C programs that work on android.