Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Masfiq
- * 21 January, 2017
- *
- * Topic: file open in different mode
- */
- /* file naqqmr: string
- Saudi Arab
- Bangladesh
- Iran
- Iraq
- Syria
- */
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main(){
- ofstream out_file;
- out_file.open("new file.txt");
- ifstream in_file;
- in_file.open("string.txt");
- char* str = new char[20];
- while(true){
- in_file.getline(str, 20);
- if(in_file.eof())
- break;
- cout<<str<<endl;
- out_file.write(str, 20);
- out_file<<'\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement