How do I specifically edit files using fstream in C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I specifically edit files using fstream in C++?

I tried indexing the lines to find things and replace them. But I am getting a problem again and again.

11th Dec 2018, 10:59 AM
pratyush kumar
pratyush kumar - avatar
1 Answer
+ 5
One code worth ten thousand explanation! It'd be great to attach it here in order to pin down the problem and lead you to the right direction, but if you want a random suggestion then store the file's content line by line in an array then edit the copied content there, and finally write the content back to file.
11th Dec 2018, 1:13 PM
Babak
Babak - avatar