Closing a File

Once the user enters the end-of-file indicator, main terminates. This implicitly invokes outClientFile’s destructor, which closes the clients.txt file. You also can close the ofstream object explicitly, using member function close as follows:

outClientFile.close();


Image Error-Prevention Tip 14.3

Always close a file as soon as it’s no longer needed in a program


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.184.117