Wednesday, November 16, 2011

C programming, Pre-defined Macro's

A typical example of using predefined macros is for reporting error conditions in a generic macro so you can find your way in the to where the problem occurred.

fprintf (stderr, "Internal error: negative string length %d at %s, line %d.",length, __FILE__, __LINE__);

__func__ (c99) and __FUNCTION__(GCC)

Information about compile

Date and time are precious to know exactly what binary you are running, with embedded systems this come up often.

__STDC_VERSION__  (doesn't work for me, but it's in doc's) 


No comments: