Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!ramsey From: ramsey@NCoast.ORG (Cedric Ramsey) Newsgroups: comp.lang.c Subject: Re: Is this bad programming? Keywords: #define array definition Message-ID: <1990Aug20.142016.21934@NCoast.ORG> Date: 20 Aug 90 14:20:16 GMT References: <1990Aug8.100614.1223@resam.dk> <1990Aug9.054556.22271@athena.mit.edu> <499@mtndew.Tustin.CA.US> Organization: North Coast Public Access *NIX, Cleveland, OH Lines: 21 In article <499@mtndew.Tustin.CA.US> friedl@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 ! ! !