List some of the drawbacks of using an array instead of a vector
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:3| Question number:3.29
All Answers
total answers (1)
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:3| Question number:3.29
total answers (1)
- The size of the array is fixed and must be known when defined.
need an explanation for this answer? contact us directly to get an explanation for this answer- Character array needs to leave space for null character at the end.
- Arrays can not be copied or assigned as a whole.
- Array can not be constructed with the same values like the constructor of
vector
when defined.- The size of
array
must be calculated when using (sometimes cannot be calculated at all) instead of calling a `size()
` method.