I have a textfile that contains this line:
C:\Program Files\app\
I want to read it to become this:
C:\\Program Files\\app\\
I know how to read the file in visual c++, but how to add a slash() everytime it founds the slash.
char str[200];
fstream file_op("C:\\path.txt",ios::in);
file_op >> str;
file_op.close();
The simplest way to do this is through loop:
Please note that you cannot change a file in place. You will have to write new strings to a new file. I am not using boost or any other library because those are not part of VisualC++ by default and your tag says you need this for VisualC++