1.

Find the odd one out.(a) std::vector(b) std::vector(c) std::vector(d) std::vectorThe question was posed to me in an internship interview.My query is from Booleans topic in section Types, Pointers, Arrays & Structures in C++ of C++

Answer»

Right answer is (d) std::VECTOR

The explanation is: std::vector is a specialized version of vector, which is used for elements of TYPE bool and optimizes for SPACE. It behaves like the unspecialized version of vector and the storage is not necessarily an array of bool values, but the library IMPLEMENTATION may optimize storage so that each VALUE is stored in a single bit.



Discussion

No Comment Found

Related InterviewSolutions