#include <iostream>
#include <fstream> using namespace std; int main() { string line; //For writing text file //Creating ofstream & ifstream class object ifstream ini_file {"original.txt"}; ofstream out_file {"copy.txt"}; if(ini_file && out_file){ while(getline(ini_file,line)){ out_file << line << "\n"; } cout << "Copy Finished \n"; } else { //Something went wrong printf("Cannot read File"); } //Closing file ini_file.close(); out_file.close(); return 0; }
Subscribe to:
Post Comments (Atom)
CONSTRUCTURE IN PARENT CLASS
class Parent { public Parent() { System.out.println("Parent Constrcutor"); } } class Child extend...
-
#include <iostream> using namespace std; void Test() { static int x = 1; x = ++x; int y = 1; y = ++y; cout<...
-
#include<iostream> using namespace std; class base { public: void fun() { cout<<" fun is a base ...
-
#include<iostream> using namespace std; int main() { int x, y, z; x=11; y=35; z= x&y; cout<<z<<end...
No comments:
Post a Comment