Mail Archives: djgpp/1999/02/10/07:07:51
Maybe this should have been posted to ...learn.c-c++, but here we go.
I'm trying to learn c++ and tried to obtain" c++ primer plus:teach yourself..."
(S.Prata). It's not going to be reprinted, so I thought I'd check out
"Thinking in c++" 2ed by Bruce Eckel (it's free at www.bruceeckel.com), but
the exampels seem to be completely incompatible with DJGPP.
Am I doing something wrong or is this correct?
An example is:
//: C18:Stype.cpp
// Type a file to standard output
#include <fstream>
#include <iostream>
#include "../require.h"
using namespace std;
int main(int argc, char* argv[]) {
requireArgs(argc, 2); // Must have a command line
ifstream in(argv[1]);
assure(in, argv[1]); // Ensure file exists
cout << in.rdbuf(); // Outputs entire file
} ///:~
Quest.: #include "../require.h"
declare _and_ open 'in' at once
assure
rdbuf
???
Hope you can help me
Regards
Lasse
- Raw text -