Assume that a file exists. How to replace the occurrence of a character with another character?

Recommended Answers

Is this your assignment or something else? looks complete but if this is homework, ignore the web and write something. Share your code and tell why you think it didn't work.

Jump to Post

All 2 Replies

If the file will all fit into memory, then the better (much faster) method is to read the whole file into dynamic memory ... traverse that data and update as desired ... then write all that updated data back to the (overwritten) file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.