GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  C++
Go To First  |  Previous Question  |  Next Question 
 C++  |  Question 54 of 203    Print  
In c++ have a default constructor ?
No


  
Total Answers and Comments: 6 Last Update: November 26, 2005     Asked by: Nisar.E 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: ganga prasad rao.aloori
 
yes in c++ a class can have a default constructor.a default constructor is  a constructor which doesn't pass any arguements to it.

Above answer was rated as good by the following members:
wael.salman
September 29, 2005 04:37:21   #1  
Richa        

RE: In c++ have a default constructor ?
Yes C++ does have a default constructor provided by the compiler.In this case all the members of the class are initialized to null values.These values act as the default values.For eg: MyClass me;In the above case since the object is not initialized to any value so the default constructor will be called which will initialize the class with the default values.
 
Is this answer useful? Yes | No
October 02, 2005 11:51:35   #2  
Jim        

RE: In c++ have a default constructor ?
A default constructor is a constuctor that can be invoked without any arguments. This could be a constructor without any parameters or a constructor that has parameters with default arguments. Only one constructor in a class can have default arguments.
 
Is this answer useful? Yes | No
October 21, 2005 03:44:23   #3  
rajkishore        

RE: In c++ have a default constructor ?
yes if the class designer donot define any constructor in the class. then the compiler provides the default constructor in the class.
 
Is this answer useful? Yes | No
November 10, 2005 11:04:11   #4  
m11aravind Member Since: November 2005   Contribution: 4    

RE: In c++ have a default constructor ?

yes In C++ we have a default constructor .

A default constructor is a constructor that can be called with no arguments. One example of this is a constructor that takes no parameters

class Fred {
public:
Fred();
// Default constructor: can be called with no args
...
};
---by moparthi Aravind


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 17, 2005 11:15:50   #5  
praveenkumar_in2003 Member Since: November 2005   Contribution: 1    

RE: In c++ have a default constructor ?
Yes we have default constructor in C++
 
Is this answer useful? Yes | No
November 26, 2005 09:23:16   #6  
ganga prasad rao.aloori        

RE: In c++ have a default constructor ?
yes in c++ a class can have a default constructor.a default constructor is a constructor which doesn't pass any arguements to it.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape