(1).defines a pointer array as follows:
char *name[] ={"January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November",
"December"};
where name is an array of pointers pointing to strings.
(2).sorts the month names in alphabetic order by arranging the values in the name array so that
name[0] points to “April ”, name[1] points to “August ”, and so on.
(3).prints the month names in alphabetic order, one name per line.
For step (2), you can use any sorting algorithm (such as the selection sort, bubble sort or quick sort
algorithm) to sort the name array. You can use the standard C library function strcmp() to
compare two strings. The function is declared in the system header file string.h as follows:
int strcmp(const char *s1, const char *s2);
It compares the two strings s1 and s2. It returns an integer less than, equal to, or greater than zero if
s1 is found, respectively, to be less than, to match, or be greater than s2.
i am really bad when it comes to programming so any help would be appreciated..thanks a lot:)