std::vector <D3DDISPLAYMODE> DisplayModes;

Started by
0 comments, last by Viri- 22 years, 7 months ago
Ok I was looking at some code that I''ve been playing with and I saw this: std::vector DisplayModes; What does this mean? I''ve been told that its a vector template and thats cool and everything but how do I use it? What is the std part? In the rest of the code I can''t find any references to the std. Do I just need an include or what? Thanks, David
------------thanks,Phoenix
Advertisement
well . std::vector belongs to the stl library.

std is the namespace used to group all the stl templates
togather.

   #include <vector>   using namespace std; vector<OBJECT> vcObject; void func() {   OBJECT myobject;    vcObject.push_back(myobject); // add to the back     vector<OBJECT>::iterator it; for(it = vcObject.begin(); it!= vcObject.end(); it++)   cout << *it; // this will access OBJECTS in the vector  vcObjects.erase(vcObjects.begin(),vcObjects.end()); // clear}  




{ Stating the obvious never helped any situation !! }

This topic is closed to new replies.

Advertisement