I have a problem when I want to print \nI use endlfor this. And the problem is that when I run the code on Windows7, it will not print a new line. But it will print a new line in Ubuntu. Both operating systems use the same GNU g ++ compiler.
\n
endl
So I am wondering if there is another way to print a new line for a file in Windows?
void translate(ofstream &out, const string &line, map<string, string> m) { stringstream ss(line); string word; while(ss >> word) { if(m[word].size() == 0) out << "A"; else out << m[word] << " "; } out << "\n"; }
"\n", endl ( - endl flushes). \n , " ", . unix , \n . Windows \n \r\n ( , ). , , .
, , Windows, , , , . , cygwin g++ - g++-, Windows, . \n.
Source: https://habr.com/ru/post/1784609/More articles:How to write your own angle / pen changes for NSWindow? - resizeIs the Deep Links request API available for Windows Phone 7 applications on the market? - windows-phone-7how to block facebook on mac - facebookRisks of using performSelectorInBackground? - multithreadingAS3: how to find out if the data provider or its content (s) has been changed - flexDefining a launch window / form on multiple displays - c #Need .ready () in jQuery - javascriptВключает ли @@IDENTITY в SP с помощью триггеров условие гонки? - sql.Net "Any infrastructure" - c #Can you share wix fragments between multiple installers? - wixAll Articles