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

Recommended Answers

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.