Possible Duplicate:
Replacing a word in a file, using C
i am doing filing in c language. i have created a txt file and write some data into it. but as my program progress i have to search some text and replace it with the other word but the problem i am facing is that suppose in my file i wrote
"i bought apple from the market"
if i replace apple with pineapples , as apple has 5 char and pineapple has 9 char it will write it as
"i bought pineapple m the market"
that it also has affect the words written after apple because of the different char length
i have use fseekpos function to find the pointer position
thanks