Aftrer main() finishes that loop reading the file the ifstream is located at end-of-file. Therefore test() can't read the file again. In test() call fseekp() to reset the file pointr back to beginning of file
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343