Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what about fstreams

Status
Not open for further replies.

rick05

Programmer
Feb 23, 2001
15
MX

hi guys,

I´m new here...

well, I wonder why or how work fstreams (flows) ifstream or ifstream... on UNIX...

I hava a small program and I can´t make it work... but this same program works fine on Borland, MSDOS...

I hope you can helpme
 
Hi,
The following works on unix

// Change quotes to &quot;<>&quot;
#include &quot;fstream.h&quot;

int main()
{

char *input;
ifstream testFile(&quot;test.txt&quot;, ios::in);

if(!testFile)
{
cerr << &quot;.........&quot; << endl;
exit(1);
}

while(testFile >> input)
cout << input;

return 0;
}

DOesn't use classes but works with classes as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top