Original Post
I have been working on an error logger for my programs and have saved myself a lot of time. But now I need it to log multiple errors that occur in a text file. I''ve been using the basic fstream.h header and created a ofstream error_log; and used that to write any errors I have through out the program. But if I need to write more then one error to a line I can''t. How else could I do this?
Here is my code:
#include
Void write_error(char *text);
ofstream error_log;
write_error("This is it being used….");
void write_error(char *text)
{
ofstream << "Error log file\n"; // line not displayed // because over written
ofstream << text << ''\n''; // only line displayed. Last error // only one dispayed
}
thanks,
Viri-