Okay I am implementing an index of words from an input text file. I have a class that contains a vector declared like this:

Code:
vector<indexWord> data;
and a struct declared like this:

Code:
struct indexWord {
        std::string value;
        std::vector<int> locations;
};
So, in essence, I am storing the words and page numbers in the indexWord struct and then storing that info in the data vector. I have an output function that should output these values. How do I go about telling the function to output the "value" and vector of locations using just the data vector?