This is my code but it doesn't work...now i am trying to read the character by character but i don't know how i should write the "if"
Code:
void first_word()
{
char s1[20],s2[20],filename1[20],filename2[20];
FILE *fp1,*fp2;
int i;
printf("\n\n Give 1st file name: ");
scanf("%s", &filename1);
fp1=fopen(filename1,"r");
printf("\n\n give 2nd file name: ");
scanf("%s", &filename2);
fp2=fopen(filename2,"w");
if(fp1==NULL)
printf("\nFile %s can't open!!!",filename1);
if(fp2==NULL)
printf("\nFile %s can't open!!!",filename2);
while(!feof(fp1))
{
fscanf(fp1, "%s", s1);
strcpy(s1[0],toupper(s1[0]));
for(i=1;s1[i]='\0';i++)
{
if(islower(s1[i]))
strcpy(s1[i],s1[i]);
else
srtcpy(s[i],tolower(s1[i]));
}
fprintf(fp2, "%s" ,s1);
}