I need to enter 5 words and then sort them alphabetically. The words are zebra, chimpanzee, dog, cat and buffalo. So far I have this, but I don't know how to call the words. Any ideas, help, suggestions, etc would be appreciated!
Code:
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[5]) {
int i = 0;
int j;
for (i = 0; i < argc; i++) {
printf("argv[%d] = %s\n", i, argv[i]);
}
int main(void);
int name;
int hold;
int last;
for (i = last ; i > 0 ; i--) {
for (j = 1 ; j <= i ; j++)
if (strcmp(name[j],name[j - 1]) < 0) {
strcpy(hold,name[j]);
strcpy(name[j],name[j - 1]);
strcpy(name[j - 1],hold);
}
printf("%s\n", name[0]);
}
return 0;
}