Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Does default constructors gets created in all scenario

This is a discussion on Does default constructors gets created in all scenario within the C and C++ forums, part of the Software Development category; I want to know if in the case of there are no user defined default constructors will the compiler generate default constructor in all situations. If there are situations in ...

Go Back   Geeks Talk > Software Development > C and C++
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 07-12-2006
Expert Member
 
Join Date: May 2006
Location: New York, USA
Posts: 118
Thanks: 0
Thanked 6 Times in 4 Posts
RyanJames is on a distinguished road
Question Does default constructors gets created in all scenario

I want to know if in the case of there are no user defined default constructors will the compiler generate default constructor in all situations. If there are situations in which compiler would not create default constructor let me know about it
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-12-2006
Contributing Member
 
Join Date: May 2006
Posts: 88
Thanks: 0
Thanked 10 Times in 9 Posts
norman is on a distinguished road
Re: Does default constructors gets created in all scenario

No there are situations in which default constructors would not be created. One of which I am aware of is if the class has constant type members say constant private members then compiler would not create default constructors for these and error would result if there is no user defined constructors defined for these.
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 04:35 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved