What is the memory overhead of having an empty vector vs having a pointer to a vector?
Option A:
std::vector<int> v;
Option B:
std::vector<int> *v = NULL;
I believe that option B takes 1 32 bit pointer (assuming 32 bit here) How much memory does the empty 'v' take up?
See Question&Answers more detail:os