guang4243
Newbie level 5
Hello, i now learning to write C++ code in linux platform
but some how i face some problem:
Here is my coding:
#include<iostream>
#include<fstream>
using namespce std;
int main()
{
ofstream Hello_test;
Hello_test.open("Hello.txt");
Hello_test<<"Test...\nTest..."<<endl;
Hello_test<<"Hello World"<<endl;
Hello_test.close();
}
After that, i success compile and run it.
In the Hello.txt file, it show that:
Test...
Test...
Hello World
This is good, because i get what i need. But when i copy this Hello.txt file to window platform, it show that:
Test...Test...Hello World
Here is my question, why the text file does not show the next line where every thing already combine together.
Is there anywhere can solve this problem?
Please Help
but some how i face some problem:
Here is my coding:
#include<iostream>
#include<fstream>
using namespce std;
int main()
{
ofstream Hello_test;
Hello_test.open("Hello.txt");
Hello_test<<"Test...\nTest..."<<endl;
Hello_test<<"Hello World"<<endl;
Hello_test.close();
}
After that, i success compile and run it.
In the Hello.txt file, it show that:
Test...
Test...
Hello World
This is good, because i get what i need. But when i copy this Hello.txt file to window platform, it show that:
Test...Test...Hello World
Here is my question, why the text file does not show the next line where every thing already combine together.
Is there anywhere can solve this problem?
Please Help