__LINE__ and __FILE__ -- a beginner's question

Mike Howard 213317-5690 howard at aic.dpl.scg.hac.com
Fri Oct 13 09:17:24 AEST 1989


In article <6257 at arcturus> evil at arcturus.UUCP (Wade Guthrie) writes:
>For what purpose are the __LINE__ and __FILE__ macros used? 
>... is there some use for the applications programmer?

I saw this in some programming article as a debugging usage, though
I've never used it:

#ifdef DEBUG
#define DTRACE(var) fprintf(stderr, "%s:%d, var=%d\n",__FILE__,__LINE__,var)
#else
#define DTRACE(var)
#endif

Mike Howard  howard at aic.hrl.hac.com



More information about the Comp.lang.c mailing list