Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what is constructor in c ++
#1
sir we can creat many constructor in a class as you said but we will pass only one distructor to all constructor . sir if we want to distruct only a perticuler constructor then what we should do . if we pass distructor then it will distruct all the constructor thanks

Reply
#2
As I understood the context of your question, please note that classes have multiple constructors but only one destructor. The destructor is automatically called when an object is destroyed. In the destructor all the cleaning task has been performed i.e. de-allocation of memory. When object is created, memory allocated to object through constructor. When object is destroyed, the destructor de-allocates the memory of that object. The destructor is called for all the objects in the class.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is constructor necessory in c++? And if than why? Vuhelper 0 1,921 11-05-2011, 05:12 PM
Last Post: Vuhelper
  Constructor for Composition of inherited classin c++ 2011 Vuhelper 0 828 07-06-2011, 06:18 PM
Last Post: Vuhelper
  What is the syntax of copy constructor in c 2011 saneha 1 1,812 05-02-2011, 05:36 PM
Last Post: Vuhelper
  explain the copy constructor, shallow copy, and deep copy with examples and c++ code saneha 1 5,439 05-02-2011, 06:45 AM
Last Post: Vuhelper
  differetiate between shallow copy and copy constructor in c++ 2011 saneha 1 1,189 04-29-2011, 08:19 AM
Last Post: Vuhelper
  what is difference between a constructor and over loaded constructor? saneha 1 1,979 04-29-2011, 08:08 AM
Last Post: Vuhelper
  constructor and destructor in c++ 2011 saneha 1 2,690 04-29-2011, 08:05 AM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)