#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream x;
x.open("k.rtf");
if("k.is_open()")
{
x <<"Write this to file and count the word while in it.\n";
x <<"while while while while while while while while while.\n";
x.close();
cout<<"Text has been writen to k.txt";
}
else
cout<<"Unable to open the file.";
getchar();
}
*** MOD EDIT: Added code tags. Please
This post has been edited by JackOfAllTrades: 16 September 2009 - 11:31 AM

New Topic/Question
Reply




MultiQuote





|