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
how would land elevation have changed if Coronado had traveled 150 miles due west from what is today Arizona instead of east toward New Mexico

C program to count the words: void CountWords();          void main()          {             printf("\n\tcount the words and enter string\n\n\n");             Count

submitting solutions in C language should not use functions from / as these files do not exist in gcc

reocord of a student and a function ctotal to calculate the marks of any three subject by using ctotal() function

Project Description: I want a script for an online poker site. It needs to be scanning all the required tables and when the table meets certain criteria it should take a seat at

Classify computer system according to capacity. How they are different from computers according to the classification of technology. Provide comparative study also.

A: no, can't. The names of, precedence of, associativity of, and arity of operators is fixed through the language. In C++, there is no operator** so you cannot create one for a


Define a function in c program: int f1() { static int x=10; return x; } int f2() { int y=5; return y; } extern int z; void f()     {

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given