Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello. I am trying to find out how to write a function to replace a string in a text file. So far i got this:
find -> is a word i am looking for replace, rep -> new word, f1 -> my file. And i'm stuck with that piece of code:

C++
while ( fgets( buff, BUFSIZ, f1 ) != NULL ) {
if ( strstr( buff, find ) != NULL ) {...


Can any one help what t0 do after that?
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900