From 24919ca4da71f9e11119aeeb1f87b37fc2fb3af1 Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Fri, 26 Jan 2024 13:51:54 -0500 Subject: [PATCH] closing the files --- lectures/01_introduction/getline.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lectures/01_introduction/getline.cpp b/lectures/01_introduction/getline.cpp index a83e014..784ce9e 100644 --- a/lectures/01_introduction/getline.cpp +++ b/lectures/01_introduction/getline.cpp @@ -50,5 +50,9 @@ int main(int argc, char* argv[]){ // print again, but this time print it to a file. outputFile << line << std::endl; } + + // after using the files, close them before exit the program. + inputFile.close(); + outputFile.close(); return 0; }