I'm Doing project on E-Book Reader Application
Can Any Help How to read RTF file using Visual C++.
Thanks in Advance.
This post has been edited by jameel4u: 31 March 2009 - 01:45 AM
You're Browsing As A Guest! Register Now... |
||
|
Become a C++ Expert!
Join 415,717 C++ Programmers for FREE! Get instant access to thousands
of C++ experts, tutorials, code snippets, and more! There are 831 people online right now.Registration is fast and FREE... Join Now!
|
||




Posted 31 March 2009 - 01:33 AM
Dream Kudos: 50
Expert In: Being annoyed with lazy people.
Posted 31 March 2009 - 04:00 AM
Posted 31 March 2009 - 09:39 PM
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string line; //this will contain the data read from the file
ifstream myfile ("example.rtf"); //opening the file.
if (myfile.is_open()) //if the file is open
{
while (! myfile.eof() ) //while the end of file is NOT reached
{
getline (myfile,line); //get one line from the file
cout << line << endl; //and output it
}
myfile.close(); //closing the file
}
else cout << "Unable to open file"; //if the file is not open output <--
return 0;
}

