Check the best File I/O tutorial, at: http://www.cpp-home.com/FileIO_tutorial.php
Ilia Yordanov, http://www.cpp-home.com ; C++ Resources