in reply to Search & Replace Across Two Files

All you are doing is reading in data - but you never write or print your modified data. So, what do you expect your program to do?

Oh, and as a general observation, do check the return value of open. Opening a file may fail.