Use of Trace macros
The trace macro is like the printf function we used in the C language before, so that the program outputs some debugging information during the running process, so that we can understand some of the program status. The difference is that the trace macro outputs only in the debugging status, and the printf function used previously has output in any situation. Like the printf function, the trace function can accept multiple parameters, for example:
Int x = 1;
Int y = 16;
Float z = 32.0;
Trace ("this is a trace statement \ n ");
Trace ("the value of X is % d \ n", X );
Trace ("x = % d and Y = % d \ n", x, y );
Trace ("x = % d and Y = % X and Z = % F \ n", x, y, z );
Note that the trace macro only works for the debug project. In the release project, the trace macro is ignored.
In debug, the trace macro is output to the output window of VC.