What is your reaction to following line of code? , C/C++ Programming

Q-What is your reaction to following line of code?

              delete this;

A: This is not a good programming Practice. A good programmer will insist that you must absolutely never employ the statement if the class is to be utilized by other programmer's instantiated as extern, static or automatic objects. That much must be obvious. The code contains two built-in pitfalls. First one, if it executes in a member function for an static, extern or automatic object, the program will perhaps crash immediately the delete statement executes. There is no portable method for an object to tell that it was instantiated on the heap, thus the class cannot assert that its object is correctly instantiated. Second one, while an

 

Posted Date: 3/20/2013 8:19:36 AM | Location : United States







Related Discussions:- What is your reaction to following line of code? , Assignment Help, Ask Question on What is your reaction to following line of code? , Get Answer, Expert's Help, What is your reaction to following line of code? Discussions

Write discussion on What is your reaction to following line of code?
Your posts are moderated
Related Questions
Type Casting Implicit type conversions, as allowed by the language, can lead to errors creeping in the program if care is not taken. Thus, explicit type conversions may be used

how i can open a file

padovan string generation till 40

Function Templates Function templates give you with the capability to write a one function that is a skeleton, or template, for a family of similar functions. In function ov


one of the applications of computers in numerical analysis is computing the area under a curve. one method of calculating the area under acurve is to divide the area int a number o

claculate 5% tax >10000 sal

Define Bitwise Left Shift and Right Shift Operators: >? The bitwise shift operators shift their first operand right (>>) or left ( // Illustration of the bitwise right shi

Define the Conditional Operator in c language? The Simple conditional operator can be carried out with the conditional operators (? And :). An expression that makes use of the

want the codings for these topic in ur experts minds.com