May 2012
Intermediate to advanced
679 pages
16h 56m
English
So far we have studied pointers and dynamic memory allocation. The most appropriate application of it is class Vector.
In our opinion, “array” is the most powerful data structure. However, its size is fixed. Normally, in a class, there are sixty students. You may develop an appropriate array to store their data. If tomorrow, five more students will be additionally enrolled; program cannot be used.
Vector is an array whose dimension can increase. You will ask me what about decrease? Well a large vector can store less data without any problem. If one can write a code to increase the capacity, he/she can easily write a method to reduce it.
Problem: Write a program to develop class Vector for storing ...
Read now
Unlock full access