need help with char array and fgets
alright, well ive been having a problem trying to get this code to work,
i have my three arrays
char first[80];
char second[80];
char third[160];
First i have to use the fgets() function to get a string from the user and store the data in the array first.. then do the same for the second array.
next, i have to use the strcmp() function to determine which string is last alphabetically.
then the strlen() function to determine which string is longest.
and last use the strcpy() and strcat() functions to take first join it to second and store the result in the array named third.
....
Code:
int main(){
char first[80];
FILE *file;
{
printf("Enter a city name:");
fgets(first, 80, file);
}
{
printf("%s", first[80]);
}
system("pause");
return 0;}
iam completely hopeless with this.... i dont understand how to use "char *fgets (char *s, int size, FILE *stream);"
if somone could help me that would be awesome, post here, e-mail me something, anytihng would be great..