Friday, 16 August 2013

Best way to store vector of structures

Best way to store vector of structures

I need to store a sorted bunch of structures. What is the best way to do
it in a vector? Should I use pointers for this or make a copy?
struct myStruct {
int i;
string str;
//whatever...
};
and then:
vector<myStruct> v;
or
vector<myStruct*> v;
Thanks in Advance.

No comments:

Post a Comment