how to implement CStdioFile::WriteLine() with native C++ and STL?
-
hello, everyone: I want to operate files without MFC. Exactly speaking, i want to read and write files only with windows standard library. now i dont know how to implement the function of CStdioFile::WriteLine() of MFC with STL,is there anyone could help me?anything will be appreciated,thanks in advance~
-
hello, everyone: I want to operate files without MFC. Exactly speaking, i want to read and write files only with windows standard library. now i dont know how to implement the function of CStdioFile::WriteLine() of MFC with STL,is there anyone could help me?anything will be appreciated,thanks in advance~
I suspect you are referring to CStdioFile::WriteString() and not WriteLine(). All you have to make sure is that single new lines (\n) are converted to carriage return and new line (\r\n). I would imagine that the std::fstream class handles this automatically, assuming the file was opened in text mode.
-
I suspect you are referring to CStdioFile::WriteString() and not WriteLine(). All you have to make sure is that single new lines (\n) are converted to carriage return and new line (\r\n). I would imagine that the std::fstream class handles this automatically, assuming the file was opened in text mode.
Thank u for your reply~ ;P std::fstream really helps me.