Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 02 / task1 / selfPrintingTask.cpp
diff options
context:
space:
mode:
1 files changed, 26 insertions, 0 deletions
-rw-r--r--Sem. 02/task1/selfPrintingTask.cpp26
diff --git a/Sem. 02/task1/selfPrintingTask.cpp b/Sem. 02/task1/selfPrintingTask.cpp
new file mode 100644
index 0000000..862cf07
--- /dev/null
+++ b/Sem. 02/task1/selfPrintingTask.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+#include <fstream>
+
+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;
+ }
+ inputFile.close()
+
+ return 0;
+}