Hi if your here to help thanks in advance. My problem is I'm writing a code to take seven strings put in by the user sort them alphabetically than print them, but I my compiler is telling me strcmp command is wrong so I cant compile it and I am sure their are other things wrong please help.
[CODE}
#include <stdio.h>
#include <string.h>
# define N_STRINGS 7
void swap(char *, char *);
void strcmp(char *, char *);
int main (void)
{
char w[N_STRINGS];
char i, j, result;
scanf("%s", w);
for (i = 0; i < N_STRINGS; ++i)
{
for (j = i + 1; j < N_STRINGS; ++j)
result = strcmp(w[i], w[j]);
if( result < 0 )
swap(&w[i], &w[j]);
printf ("%s",w[j]);
}
return 0;
}
void swap(char *p, i *q)
{
int tmp;
tmp = *p;
*p = *q;
*q = tmp;
}
[/code]