Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main() {
- filebuf inFileBuf;
- if (inFileBuf.open("text.dat", ios_base::in) == nullptr) {
- cout << "File 'text.dat' is not existing";
- return 0;
- }
- istream inFileStream(&inFileBuf);
- while (true) {
- char c = inFileStream.get();
- if (c == EOF)
- break;
- cout << c;
- }
- inFileBuf.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement