#include // cin, cout #include // ifstream const int LINE_BUFFER_SIZE = 1024; int main() { std::ifstream sourceFile("exercise01.cpp"); if (!sourceFile.is_open()) { std::cout << "Error: Couldn't open file!" << std::endl; return -1; } char buffer[LINE_BUFFER_SIZE]; while (!sourceFile.eof()) { sourceFile.getline(buffer, LINE_BUFFER_SIZE); std::cout << buffer; if (!sourceFile.eof()) std::cout << std::endl; } sourceFile.close(); }