Can we create an array of objects for a class having default constructor?. Justify your answer.
sami9356 0 Newbie Poster
Recommended Answers
Jump to PostWe can create an array of objects for any class , irrespective of whether it has a default constructor or not
Is the above really true?
Please see ...
http://en.wikipedia.org/wiki/Default_constructor
and …
Jump to PostThe C++ default constructor has no argument at all. So if you don't define a constructor at all, that and the default copy constructor are the only constructors in the class. In that case:
Myclass a[10]; //Valid. Myclass b[2] = {0, 1}; //Error.
But If you …
All 7 Replies
Avishek_1 -3 Newbie Poster
David W 131 Practically a Posting Shark
Akash_Soni 0 Newbie Poster
David W 131 Practically a Posting Shark
Akash_Soni 0 Newbie Poster
Akash_Soni 0 Newbie Poster
tapananand 13 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.