If you make a vector of a class of no designated size, as you reserve spaces inside the vector will it just make a default instance from the constructor?
arreyes
0
Newbie Poster
Recommended Answers
Jump to PostProbably, you can check it out pretty easy.
Be careful of the word size. size is frequently used to indicate the actual number of elements currently in the vector as opposed to the number of elements for which space is allocated for vector use, which might be called capacity …
Jump to PostFortunately you CAN'T invent a "class of no designated size" in C++. For every class its objects have fixed and defined size (remember operator sizeof).
If you mean a class with dynamically allocated members then it's a problem of this class constructor, not a vector container. That's why class constructors …
All 6 Replies
Lerner
582
Nearly a Posting Maven
ArkM
1,090
Postaholic
arreyes
0
Newbie Poster
MosaicFuneral
812
Nearly a Posting Virtuoso
Manutebecker
0
Junior Poster in Training
ArkM
1,090
Postaholic
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.