With this program, I need to have the user input 7 strings, and the function will sort them alphabetically and print them. Here's what I've got.
The problem is, when i delete the scanf portion and change
#define N_STRINGS 7
printf("Please type %i words: ",N_STRINGS);
temp = *(input +a);
*(input+a) = *(input+b);
*(input+b) = temp;
else if(*(*(input+a)+x) < *(*(input+b)+x))
printf("\n Here's the sorted words: \n%s\n",*(input+x));
this program will work, but it won't work with the user's input.
char *input = "this","is","my","very","short","sample","sentence";
Any ideas, please respond.