Question: Sometimes, it is desirable that an empty vector be as small as possible. For example, someone might use vector>> a lot but have most element
Sometimes, it is desirable that an empty vector be as small as possible. For example, someone might use vector>> a lot but have most element vectors empty. Define a vector so that sizeof(vector) ==sizeof(int*), that is, so that the vector itself consists only of a pointer to a representation consisting of the elements, the number of elements, and the space pointer.
Step by Step Solution
3.50 Rating (160 Votes )
There are 3 Steps involved in it
It sounds like you are trying to create a vectorlike data structure that only stores a pointer to th... View full answer
Get step-by-step solutions from verified subject matter experts
