So if input.txt is:
input.txt
abd123 123gy dhakf hu123
and target string is "123"
"123"
I need the result.txt to be:
result.txt
abd123 123gy hu123
I would use something like
while(fscanf(fp1, target, ...) != 0) fputs(target, fp2);
I have to do this without using functions of string.h.
string.h
I would use getline to read every line of the file and use strstr to check if it contains the line that you are looking for. That should be enough to go off, good luck :)
getline
strstr
2.1m questions
2.1m answers
60 comments
57.0k users