std::vector <D3DDISPLAYMODE> DisplayModes;
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
well . std::vector belongs to the stl library.
std is the namespace used to group all the stl templates
togather.
{ Stating the obvious never helped any situation !! }
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
Popular Topics
Advertisement