C-Sorting days of the week
Ok so I have an array that lists the 5 weekdays in order:
char *days[5]={"Monday","Tuesday","Wednesday","Thursday","Friday"};
Now I have some struct arrays and one of the elements are the days of the
week and they are not in order, they are in random order like:
d[0].day is "Thursday"
d[1].day is "Monday"
d[2].day is "Wednesday"
Now inconveniently the days aren't in alpha order :p so that makes me
wonder how I can implement a sort of some kind =/
No comments:
Post a Comment