Running an .exe file but skipping the cout lines

hello everybody,
I've written a code for my university and, since i m pretty new at C++, it has a lot of "cout" inside to keep tracks of what the programme is doing.

Is there a way to start the resulting .exe file but ignoring all the couts?

Thanks a lot everybody for the help

F.P.
Last edited on
You need to code for that behavior. One possibility is to create a Log() function or macro that undefines itself when you compile in release mode (talking Visual Studio jargon here).

Example:

1
2
3
4
5
#ifdef DEBUG
#define LOG(x) cout << x << endl;
#else
#define LOG(x) 
#endif 


Just get creative with the capabilities of the language.
When you don't want to be able to cout any more, and as long as they are one-liners, you can do this:
#define cout /##/
This makes cout be replaced by // to literally comment out the code.
thanks a lot for the useful tips.
i thought there was a specific command, but one of these suggestions will make the job. silly of me not thinking to a #define ...
thank you all!
Topic archived. No new replies allowed.