Is this bad programming?

Cedric Ramsey ramsey at NCoast.ORG
Tue Aug 21 00:20:16 AEST 1990


In article <499 at mtndew.Tustin.CA.US> friedl at mtndew.Tustin.CA.US (Steve Friedl) writes:
>Steve Summit writes:
>> [Others] worry about keeping error numbers in sync with an array of
>> error message strings so that the array can be indexed by the
>> array number.
>> 
>> Whenever I'm serious about making the connection between error
>> numbers and messages explicit rather than implicit, I do so
>> quite, er, explicitly:
>> 
>> 	#define	FILE_FOOTER_ERROR		1
>> 	#define	DRAW_FOOTER_ERROR		2
>> 
>> 	struct errmess { int em_number; char *em_text; } errmesses[] =
>>	{ FILE_FOOTER_ERROR,	"File footer error",
>>	  DRAW_FOOTER_ERROR,	"Draw footer error",
>>	  ... };

[deleted stuff]

	If you have to ask then it probably is ! ! !



More information about the Comp.lang.c mailing list