C++ Item Inventory Application 1 Demo

146 Просмотры
Издатель
This is a console program demonstrating the use of vectors.
A vector is a an object in C++, and it represents a collection of items which can be objects themselves.
A vector is 'like' an array, but not really.
A vector can expand and contract as needed, but an array cannot.
An array can effectively get 'smaller' just by effectively not using all you space that is allocated to it, but it cannot get larger that its initial size without performing some dynamic allocation.
Of course, a vector resizes in that way too, but this is hidden from the user.
That's how a good object behaves; flexibly, and in the background without all the gory details.
Категория
Язык программирования C++
Комментариев нет.