C++ programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skauras
    New Member
    • Apr 2007
    • 2

    #1

    C++ programming

    Hi, i want to ask about constructors and destructors in c++
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by skauras
    Hi, i want to ask about constructors and destructors in c++
    Please feel free to do so.

    kind regards,

    Jos

    Comment

    • Extremist
      New Member
      • Jan 2007
      • 94

      #3
      Code:
      class name{
                                public:
                                           name();  // constructor
                                           ~name(); // deconstructor
      what do you want to know?

      Comment

      • Indianraja
        New Member
        • Apr 2007
        • 22

        #4
        Originally posted by skauras
        Hi, i want to ask about constructors and destructors in c++
        tel yar.. what u want wheter definiton r anything else....

        Comment

        • slsenthilkumar
          New Member
          • Apr 2007
          • 1

          #5
          Originally posted by skauras
          Hi, i want to ask about constructors and destructors in c++
          Class name and constructor names are same. Destructor gets a ~ symbol before the name.

          When the object creates the contructor invoked .
          when the object delets the destructor invoked.

          Mostly contructor used to allocate the memory and initiate the members.
          Destructor used to deallocate the memory.

          Comment

          Working...