home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_06
/
8n06077a
< prev
next >
Wrap
Text File
|
1990-05-02
|
894b
|
31 lines
*****Listing 9*****
Text File:
TOOBIG Value cannot be larger then %d
BADNAME The name %s is not defined
PUNT Unknown error, aborting
Sample output of special program:
header1:
enum errkind { TOOBIG, BADNAME, PUNT };
header2:
char *errstring[] = {
"Value cannot be larger then %d",
"The name %s is not defined",
"Unknown error, aborting",
};
Sample Usage:
/* ANSI prototype */
extern void error(enum errkind, char*);
error(TOOBIG, (char*)MAX);
error(BADNAME, str);
error(PUNT, 0); /* the 0 is ignored in this case */
The error() function is a small printf-like function
which is very easy to write.