Some type of container for string int long long

Hello,

I am currently doing a project for school and having a great deal of frustration with it. I am trying to find a way to make it possible so that I have some sort of container such as a vector to hold a string, an int, and a long long. The reason for this is to do something as so...

".mp3 2 23434252"

This is an example of a file extension, the number of times occurred, and file size. I also need it to be able to sort. I have no problems finding the file extension, count, or file size. My greatest deal of pain is finding a way to contain these in a simple way.

Any information would be greatly appreciated. Thank you.

I would create a struct to store in the vector:

1
2
3
4
5
6
7
8
struct item
{
	string name;
	long filesize;
};


vector<item> items;


As I see it, you don't want to store the number of times that item occurs as it would be a property derived from the whole vector and you wouldn't want (you may do or may not, I don;t know) to store that value across all items.
Thank you so very much! Didn't even think to do a struct.
So far it's working not too shabby.
Topic archived. No new replies allowed.