EDIT: Again, after searching for some time and not finding any answers then asking here and going back to experiment a bit with my code, I figured out the answer just by trial and error :|
Hi!
My current homework assignment requires me to read some info from a file, store the info in structures, store the structures into a vector, sort the info, and let the user do some searches.
Now, I believe I have the input part ready and I'm stuck in the outputting/sorting part. After I store a structure into a vector, how do I read its stored data?
Lets say I have a structure like the following:
struct Info{
string name;
double telNum;
string street;
string city;
string state;
string zipC;
};
and I store the structure into a vector in the following way:
//...
Info person;
vector<Info> People
// ... store data in the structure ...
People.push_back(Person) // Is this the right way
//to store a strc in a vector?
//...
How would I then ouput the structure to the screen?
Should be something easy :)
Thanks