Comparator to sort the array of dates
int myCompare ( string date1 , string date2 ) { string day1 = date1 . substr ( 0 , 2 ) ; string month1 = date1 . substr ( 3 , 2 ) ; string year1 = date1 . substr ( 6 , 4 ) ; string day2 = date2 . substr ( 0 , 2 ) ; string month2 = date2 . substr ( 3 , 2 ) ; string year2 = date2 . substr ( 6 , 4 ) ;