What is wrong with Struct?

Marc WANDSCHNEIDER storm at cs.mcgill.ca
Sat May 11 15:38:27 AEST 1991


What is wrong with the following delcaration in my file sim.h:


typedef struct HP {
		int last;
		Eventtype items[MAXHEAP];
} Heaptype;


For some reason, this only works if I remove the MAXHEAP (which was #defined).
Why?


Also, in the main program (which has an #include "sim.h"), the following don't
work:

	Queuetype Qu[MAXPROCS];
	char G[MAXPROCS][MAXPROCS], R[MAXPROCS][MAXPROCS];

Queuetype and the others are typedef'd and #defined in sim.h.

The error I get with first line there is:

Array bounds missing ] in function main.

The second line just gives SYNTAX error.

Any ideas whad be happening?

./*-

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
storm at cs.mcgill.ca         McGill University           It's 11pm, do YOU
Marc Wandschneider         Montreal, CANADA            know what time it is?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Comp.lang.c mailing list