|
From: michele <mic...@li...> - 2004-04-02 08:50:08
|
Another ex (from Lippman, I hope he doesn't be offended, I have just =
bought his book, I think it's good... )
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
// open a file for output
ofstream outfile("out_file");
// same for input
ifstream infile("in_file");
if(!infile){
cerr << "error... "<<endl;
return -1;
}
if(!outfile){
cerr << "error...."<<endl;
return -2;
} =20
=20
string word;
while(infile>>word)
outfile << word << ' ';
return 0;
}
----- Original Message -----=20
From: Chello=20
To: dev...@li...=20
Sent: Thursday, April 01, 2004 7:56 PM
Subject: [Dev-C++] just help
how to use string with dev c++ i tried everything by
|