C++ ifstream rdbuf()
send its buffer to cout
#include <fstream> #include <iostream> using namespace std; int main()//from w ww.j a v a 2s. c o m { ifstream infile("TEST.TXT"); //create file for input cout << infile.rdbuf(); //send its buffer to cout cout << endl; return 0; }