When i develop a destructor, do i require to explicitly call, C/C++ Programming

When I develop a destructor, do I require to explicitly call the destructors for my member objects?

 

 

Posted Date: 3/15/2013 5:41:02 AM | Location : United States





A: yes.

Imagine that List is the name of some class. Function f() declares a local List object called x:

void f()

{

List x; // Local object named x (of class List)

...

}

However function g() declares a function called x() that returns a List:

void g()

{

List x(); // Function named x (that returns a List)

...

}

 

 

 

 

Posted by | Posted Date: 3/15/2013 5:41:20 AM


Related Discussions:- When i develop a destructor, do i require to explicitly call, Assignment Help, Ask Question on When i develop a destructor, do i require to explicitly call, Get Answer, Expert's Help, When i develop a destructor, do i require to explicitly call Discussions

Write discussion on When i develop a destructor, do i require to explicitly call
Your posts are moderated
Related Questions
How to use HTTP Headers inside PHP? Write the statement through which it can be added? HTTP headers can be used in PHP by redirection that is written as: Headers can be

Write a C program to calculate the output Y for a given value of X for the following formula   Y=X 2 + 2X +3   #include stdio.h   void main()   {   char promt;   float y,x

Array types An array is a collection of objects of a one data type. The individual objects are accessed by their position in the array. This way of accessing is known as indexi

please provide me the assignment help. What is the difference between a copy constructor and an overloaded assignment operator?

1. Using Visual C++ and your OpenGL configured environment, write an application that displays a “unique” graphical scene that you designed and coded for this course. What yo

Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.

Static Member Functions All the objects of the class share static data members of a class. The example above demonstrates how to keep track of all the objects of a class which

Explain about the String Constants in c language? A collection of characters included within a pair of double quotes is treated as string constant. The character may be numbers

#include stdio.h #include math.h float discharge(float,float); void main()   {   char prompt;      float time,out,cr;   cr = 100e-6;   for (time = 0;time   {   /* call th

Define the Data Type Modifiers in C language? There are three data types(int, float & double) above have the following modifiers. 1. short 2. long 3. signed 4. unsigned