The following C++ code:
ofstream out("File.txt");
const char *str = "0\r\n1\r\n2\r\n";
out << str;
Creates following file (File.txt above):
Why is there extra CR's and LF's? My platform is Windows 7 and compiler VS 2013.
The situation above will cause problem with another of my program that will parse this file line by line and that program assumes that every line will contain data. I could remove empty lines but I want to understand why when str
is saved, there are extra CR's and LF's.