Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!pyramid!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.lang.c Subject: Re: C Coding Question Message-ID: <6017@sun.uucp> Date: Sun, 10-Aug-86 19:20:59 EDT Article-I.D.: sun.6017 Posted: Sun Aug 10 19:20:59 1986 Date-Received: Tue, 12-Aug-86 12:57:42 EDT References: <248@killer.UUCP> Organization: Sun Microsystems, Inc. Lines: 24 > Here's the question: Should help and description be declared char *help[] > or char **help? Since you've already shown a declaration for them, and since you've done it correctly, I'm not sure why you're asking. Since "help" would be an array of pointers to characters, which is in no way equivalent to a pointer to a pointer to a character, you obviously declare it as such - "char *help[]". Try it the other way ('char **help = { "foo", "bar", ... };') and the compiler will let you know, in no uncertain terms, that it's not correct. > Should say() be declared void, or is there some sort of error checking I > should implement? That depends on whether you can do anything useful if you detect an error. For example, it's rarely useful to check for errors on an "fprintf" to "stderr" - if it fails, what can you do, print a message to "stderr" indicating you can't print a message to "stderr"? (The VMS routine that prints error messages never returns a failure indication, probably for much the same reason.) Even if you have something useful to do on an error, you may want to do it entirely within "say". -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)