I need to get number of characters in each line and then paste it into another file (school project) but even my prototype is already not working.
I have already trying continuing seeing whether problem resolves itself when I paste it into another file but it didn't work so I'm back to this.
int main()
{
FILE *fw;
FILE *fr;
int i = 0;
char c;
fr = fopen("vstup.txt","r");
fw = fopen("vystup.txt","w");
while ((c = getc(fr)) != EOF)
{
while ((c = getc(fr)) != '\n')
{
i++;
}
printf("%d\n", i);
}
}