I'm trying to use an fstream in C++ and I keep getting the following error:
/usr/include/gcc/darwin/2.95.2/g++/streambuf.h:132: `ios::ios(const ios &

' is private within this context
The following will cause the error:
Code:
#include <iostream>
#include <fstream>
#define BUFFER_SIZE 256
int main(int argc, char *argv[]) {
char buf[BUFFER_SIZE];
ifstream fin = ifstream("foo.cpp");
while (!fin.eof()) {
fin.read(buf, BUFFER_SIZE);
cout.write(buf, fin.gcount());
}
fin.close();
return 0;
}
I am running OS X 10.1.5 on a B&W @ 350MHz if that helps.