#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
usingnamespace std;
class Stuff
{
public:
string Word;
int num;
int num2;
};
int main()
{
vector<Stuff> Words;
Words.resize(Words.size() + 3);
Words[0].Word = "Apple";
Words[1].Word = "Villain";
Words[2].Word = "Person";
sort();
for(int i = 0; i < (int)Words.size(); i++)
{
cout << Words[i].Word << endl;
}
return 0;
}
But what about this? theres different values in the class and if I try Words.Word.begin() that doesn't work because i need to sort the strings in each class. Any ideas?