Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

why all c++ program must have default constructor?

Answer Posted / sourisengupta

When you create a Object with no arguments, the compiler automatically creates a default constructor internally. But when you use parameterized constructor in your code then you need to provide the default constructor in your code so that the compiler does not throw any errors at compile time.

It also depends on compiler. some compiler also supports this feature. then you do not need to write default constructor in the code.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to interchange 2 variables without using the third one.

1041


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

1072


What is searching?

1103


What are the two main components of c++?

1095


Describe the process of creation and destruction of a derived class object?

1107


Is c++ slower than c?

1027


How do you write a function that can reverse a linked-list?

1094


How is computer programming useful in real life?

1052


What are punctuators in c++?

1149


What does namespace mean in c++?

1067


What are the c++ access specifiers?

1405


What is exception handling? Does c++ support exception handling?

1026


Write some differences between an external iterator and an internal iterator?

1009


How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

1024


Do you know what is overriding?

1179