[comp.lang.c] typedef struct a_name list_type[MAX];

rburgess@milton.u.washington.edu (Rick Burgess) (06/19/91)

Can somebody tell me how to do the following (I get an error message):

#define MAX 500
struct a_name
{
	short x;
	time_t y;
	char z;
}	/* in other words, some miscellaneous, properly defined struct */

typedef struct a_name list_type[MAX];

I presume there is just some little syntax problem here, or that it just
cannot be done.  The VAX/VMS compiler I'm using bombs out saying:

%CC-W-TYPECONFLICT, "struct" conflicts with a previous data type in this
	declaration;  previous data type ignored.

Thanks ahead of time for any responses either via email, or posted.

rburgess@austen.u.washington.edu

wittig@gmdzi.gmd.de (Georg Wittig) (06/19/91)

rburgess@milton.u.washington.edu (Rick Burgess) writes:

>#define MAX 500
>struct a_name
>{
>	short x;
>	time_t y;
>	char z;
>}	/* in other words, some miscellaneous, properly defined struct */
 ^^^^	semicolon missing!!!
>
>typedef struct a_name list_type[MAX];
-- 
Georg Wittig   GMD-Z1.IT   P.O.Box 1240 | "Freedom's just another word
D-W-5205 St. Augustin 1	   (Germany)	|  for nothing left to lose"
email:		wittig@gmdzi.gmd.de	| (from "Me and Bobby McGee",
telephone:	(+49) 2241 14-2294	|  Janis Joplin, Kris Kristofferson)

boyd@prl.dec.com (Boyd Roberts) (06/19/91)

In article <1991Jun18.201913.16800@milton.u.washington.edu>, rburgess@milton.u.washington.edu (Rick Burgess) writes:
>> struct a_name
> {
> 	short x;
> 	time_t y;
> 	char z;
> }	/* in other words, some miscellaneous, properly defined struct */
> 

Sorry, where's the trailing semicolon?  struct a_aname { ... }; <-


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''