C++ sorting help!

hi there so i have a txt file containing dates
eg 12 February 2013
14 March 2012

i am trying to make an algorithm so that i can sort the dates in order...can someone please advise me a good possible approach i can use....im really new to programming so please use simple language

I would start of making it sort a simple array, before you get into trying to parse and sort a text file with 3 values :3
Give an integer value to each month from 1 to 12 like the string "March" = 3

Store each of day, month, year into a 2 dim array of i entries and 3 elements. Then sort based first based on year (the easy one)
then on month (only for those years that are the same)
then on day (only for those days that are in the same month AND in the same year)

Write some code for more help. Good luck

Use enums for months. For that you will have to make an extraction operator that cin>> s a string, and switches it for the right enum value.
Topic archived. No new replies allowed.