GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Programming  >  C++

 Print  |  
Question:  In c++ have a default constructor ?


Answer: No


September 09, 2005 04:37:21 #1
 Richa   Member Since: Visitor    Total Comments: N/A 

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.
     

 

Back To Question