can we create instance of a vector?
can we create instance of a vector?
Yes, obviously, if we're talking about std::vector.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Creating an instance of a vector as opposed to doing what else with it?
ya i was talikg about std:vector
i know this question may sound silly to you but i am a begineer!
The whole STL would be rather meaningless if we couldn't instantiate any of the containers/objects that are described within it.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
Since std::vector is a template, you need to specify a type to create an instance of it. eg.
Code:std::vector<int> intVec;