Hai to all,
i had tried to read the contents of a text file and write that contents into
another text file...
But when i used the same codings for reading the contents of a ms word doc file and writing it into another ms word doc file, itz not working...
Here the codings i had used...
what shall i do for doc files...Code:#include <iostream> #include <fstream> #include <string> #include <conio.h> using namespace std; void main () { string line; ifstream myfile ("C:/1.doc"); if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); cout << line << endl; } myfile.close(); } else cout << "Unable to open file"; ofstream myfile1; myfile1.open ("C:/2.doc"); myfile1 << line; myfile1.close(); getch(); }
Can any one plzz explain me?
senthil.


Reply With Quote
