c++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dhanyaspai
    New Member
    • Mar 2008
    • 1

    c++

    what is constructor in c++?
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by dhanyaspai
    what is constructor in c++?
    First search in the net or if you have a godd c++ book you can get the answer for this easily.


    Raghuram

    Comment

    • romcab
      New Member
      • Sep 2007
      • 108

      #3
      When you create an object by calling "new", constructor is called.

      Comment

      • TKM
        New Member
        • Dec 2007
        • 11

        #4
        If a class has a constructor defined, then whenever an instance of the class is created, the constructor would be automatically called. What the constructor does is to initialize the members of that class; according to how you have defined within the constructor itself.

        Comment

        • kirubanantham
          New Member
          • Nov 2006
          • 8

          #5
          Constructor is also a function of a class but has the same name of that class. for example if you are creating a class let us call it as Test then the constructor is a function that has same name Test(arguments) ; this constructor will be called automatically when you are creating object for this class(Test).

          Constructor and Destructor are very basic in C++. so i suggest you to study C++. you may get lot of free e-book for C++ if you search in Google.

          Comment

          Working...