• Advertisement

Archived

This topic is now archived and is closed to further replies.

std::vector <D3DDISPLAYMODE> DisplayModes;

This topic is 5977 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 !! }

Share this post


Link to post
Share on other sites

  • Advertisement