What is the method to write to and read from a external text file using C/C++?