>> char names[10];
>>scanf("%s",n);}
the above is incorrect.
1. you need and array of 10 strings. What you posted is one array of 10 characters.
you have to pass a character array, not an integer
char names[10][10];
for(n=0;n<10;n++){
scanf("%s",names[n]);}
}
One major problem with scanf() is that you can type as many characters into the string as you want and scanf() will simply overwrite your buffer with no bounds checking. This will probably cause your program to crash. fgets() is better than scanf() because fgets() you can tell it how many caracters to accept.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
There are lots of other descriptions for arrays. Yes, your program uses arrays. post what you are typing for each of the names.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343