"Write a program that will create userids for email addresses of a company. Names of employees will be contained in a file. Your task is to read the file character by character."
- input file: "employee.dat" has the following names = SS van der Merwe;PJ Ferreira;HW du Plessis;DF Kodisang;AA Papoudopolous;G Mhlanga;TRF Schoeman;LJ Marais-Le Roux;CG Roux;B Nicholaidis;TT Tshabalala;RV Mississipi;
When the user enters any of those names, the output should be a user ID, for example: SS van der Merwe = ssvandme.
My program is able to ask for a name but it just doesn't save anything to the output file, userid.dat. Please help.
You really should try to avoid the C function exit(), it doesn't know about C++ classes and can cause data loss if used inappropriately. Since this is C++ start thinking about using exceptions when you need to "abort" the program.
You should also start thinking about using RAII techniques, which in this case, means letting the destruction of objects be done automatically, the stream.close() functions should be rarely needed let the destructor do it's job when the instance goes out of scope.