Feb 23, 2001 #1 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 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
Feb 23, 2001 #2 newbieatassembly Technical User Oct 4, 2000 39 IN Hi, The following works on unix // Change quotes to "<>" #include "fstream.h" int main() { char *input; ifstream testFile("test.txt", ios::in); if(!testFile) { cerr << "........." << endl; exit(1); } while(testFile >> input) cout << input; return 0; } DOesn't use classes but works with classes as well. Upvote 0 Downvote
Hi, The following works on unix // Change quotes to "<>" #include "fstream.h" int main() { char *input; ifstream testFile("test.txt", ios::in); if(!testFile) { cerr << "........." << endl; exit(1); } while(testFile >> input) cout << input; return 0; } DOesn't use classes but works with classes as well.