C inconsistency?

Colin Plumb w-colinp at microsoft.UUCP
Sat Apr 1 12:20:17 AEST 1989


sarathy at gpu.utcs.UUCP (Rajiv Sarathy) wrote:
> 	struct element {
> 	    char *key;
> 	    int level;
> 	    struct element **fpointer;
> 	}
> 	struct element *head[LEVELCAP];     /* array of pointers to struct */

You forgot the semicolon after the closing brace.

It should either be
	struct element {
	    char *key;
	    int level;
	    struct element **fpointer;
	};
	struct element *head[LEVELCAP];     /* array of pointers to struct */
or 
	struct element {
	    char *key;
	    int level;
	    struct element **fpointer;
	} *head[LEVELCAP];     /* array of pointers to struct */

The original parses as "struct element struct element *head[LEVELCAP];",
which I think you'll agree is a bit hard on a non-AI parser.
-- 
	-Colin (uunet!microsoft!w-colinp)

"Don't listen to me.  I never do." - The Doctor



More information about the Comp.lang.c mailing list