All IT and Non IT Interview Questions, MCQs, Online Quiz Questions, Engineering VIVA Questions
Tuesday, 17 April 2012
Can an array be replaced with a template container class? | C++
Arrays are very similar to pointers. You cannot add values to an array as well as to a pointer. Instead of using arrays, a template container class, such as vector class from Standard Template Library (STL) should be used. You can add information to and remove information from the end of the vector class without much overhead. Instead of using raw arrays, using namespace std::vector should be used.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment