I have an ErrorLog class that is used to write and modify log files. I would like to write it before and after major events for debugging purposes, and I want to use only one instance of the ErrorLog class for the entire application. I tried declaring the ErrorLog object global by placing
ErrorLog exe_log;
to the header file so that it is available to other files, but I continue to receive an error message that is already defined. Is there a way to prevent global objects?
c ++ scope global-variables
Dooms101 Aug 28 '10 at 17:42 on 2010-08-28 17:42
source share