hello,
I want to read a line in a file1.txt and check if the first letter contains 'a' or 's' , then print it in another file file2.txt.
I am trying it by fread and fwrite.
I did it for single line in file1.txt.
ie., I define character string to 100 characters , as char c[100];
I restrict to read a line of 20 characters only. ie. fread(c,1,20,file2);
but, I cann't able to read the next line to check whether it stars with 'a' or 's'.
what can i do to read each line in the file1.txt file.
thank you.