guang4243
Newbie level 5
- Joined
- Sep 27, 2011
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Malaysia
- Activity points
- 1,338
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