From 51f517bf92ce0aa616de37dd73074ce3e3579875 Mon Sep 17 00:00:00 2001 From: Angeld55 Date: Fri, 5 Mar 2021 14:39:17 +0200 Subject: sem 2 --- Sem. 02/selfPrintingTask.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Sem. 02/selfPrintingTask.cpp (limited to 'Sem. 02/selfPrintingTask.cpp') diff --git a/Sem. 02/selfPrintingTask.cpp b/Sem. 02/selfPrintingTask.cpp new file mode 100644 index 0000000..e269707 --- /dev/null +++ b/Sem. 02/selfPrintingTask.cpp @@ -0,0 +1,26 @@ +#include +#include + +using namespace std; + +const int MAX_SIZE = 1024; +int main() +{ + ifstream inputFile("selfPrintingTask.cpp"); + + if (inputFile.fail()) + { + cout << "Error!" << endl; + return -1; + } + + while (!inputFile.eof()) + { + char buff[MAX_SIZE]; + inputFile.getline(buff, MAX_SIZE); + cout << buff << endl; + } + + + return 0; +} \ No newline at end of file -- cgit v1.3.1-23-gd82d