Why con't we use vectors instead of arrays ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why con't we use vectors instead of arrays ?

c++

14th Oct 2018, 7:43 AM
√!π😊d
√!π😊d - avatar
2 Answers
+ 2
Vectors occupies much more memory in exchange for the ability to manage storage and grow dynamically whereas Arrays are memory efficient data structure. This can be a reason why we use arrays rather than vectors in C++ But if we see, vectors are dynamically sized which is a major advantage..!!.
19th May 2019, 11:48 AM
Vaishnavi Rajkumar Pawar
+ 1
no one knows
14th Oct 2018, 10:22 AM
√!π😊d
√!π😊d - avatar