lab 10: init

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-12-26 18:38:55 +05:30
parent 42902fa122
commit 9e7cffdc32
9 changed files with 298 additions and 2 deletions

26
lab10/28.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include <fstream>
#include <iostream>
using namespace std;
const string FILE_PATH = "./28.in";
int main() {
string line;
fstream file;
file.open(FILE_PATH, ios_base::in);
if (!file.is_open())
exit(1);
while (getline(file, line)) {
cout << line;
if (file.peek() != EOF) {
cout << endl;
}
}
file.close();
return 0;
}