I have to write an interactive program using scanf() to read in seven strings input by the user. The program should print the seven strings as a list, then sort them alphabetically and print a new list. I have to use the function strcmp() to assist in the sorting of the strings and also use the preprocessing directive #define N_STRINGS 7. The program must sort a different number of strings by changing only that line. This is what I have so far.
#include stdio.h
#include string.h
#define N_STRINGS 7
#define arrayword 15
#define maxletters 15
int main(void)
{
int i, j, c;
char line[N_STRINGS][arrayword];
char temp[maxletters];
printf("\nPlease type in %d words : ",N_STRINGS);
for (i = 0; i < N_STRINGS; ++i)
scanf("%s", line);
printf("\nHere is the list you entered:\n\n");
for (i = 0; i < N_STRINGS; ++i)
printf("%s\n", line);
printf("\n\nalphabetically sorted for you:\n");
for (i = 0; i < N_STRINGS; ++i)
printf("%s\n", line);
return 0;
}Error 1 error C2006: '#include' : expected a filename, found 'identifier' c:\documents and settings\skyah\my documents\visual studio 2005\projects\10 10\10 10\10 10.cpp 1
Error 2 fatal error C1083: Cannot open include file: '': No such file or directory c:\documents and settings\skyah\my documents\visual studio 2005\projects\10 10\10 10\10 10.cpp 1
PLEASE HELP ME IF YOU CAN.
Can someone please help me? These are the error messages i received: