C Coding Question

Tad Marko tad at killer.UUCP
Sun Aug 10 07:39:27 AEST 1986


[line eater fodder]

Hey, everybody, I discovered a "new" (new to me) way of coding such static
things as descriptions, helps, and the like.  It goes like this:

#include <stdio.h>

char *help[] = {
	"You do it this way, dummy:",
	"",
	"so on and so forth...",
	NULL
	};

char *description[] = {
	"I do this...",
	"no much of anything...",
	NULL
	};

main()
{
	say(help);
	printf("\n");
	say(description);
}

say(dp)
char *dp[];
{
	while (*dp != NULL)
		printf("%s\n", *dp++);
}

Here's the question:  Should help and description be declared char *help[]
or char **help?  Should say() be declared void, or is there some sort of 
error checking I should implement?  Are there any other suggestions or
comments?  How about any other neat "tricks" anyone has discovered lately?

						Tad
--
Tad Marko
..!ihnp4!killer!tad		||	..!ihnp4!alamo!infoswx!ntvax!tad
UNIX Connection BBS AT&T 3B2		North Texas State U. VAX 11/780
If it's not nailed down, it's mine; If I can pick it up, it's not nailed down.



More information about the Comp.lang.c mailing list