Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!chaph.usc.edu!alcor.usc.edu!jeenglis From: jeenglis@alcor.usc.edu (Joe English) Newsgroups: comp.lang.c Subject: Re: What is wrong with Struct? Message-ID: <17219@chaph.usc.edu> Date: 11 May 91 09:39:24 GMT References: <1991May11.053827.18109@cs.mcgill.ca> Sender: news@chaph.usc.edu Organization: Save the adverb. Lines: 33 Nntp-Posting-Host: alcor.usc.edu storm@cs.mcgill.ca (Marc WANDSCHNEIDER) writes: > >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? That depends, of course, on what MAXHEAP was #defined *to*. You didn't include the definition in your post, but this: >Array bounds missing ] in function main. looks familiar... A mistake that I frequently make is to #define MAXTHING 256; instead of #define MAXTHING 256 /* Note: no semicolon here */ Remember that a macro definition consists of the entire line. You may be getting "Eventtype items[MAXHEAP;];", which is a syntax error. --jeenglis@alcor.usc.edu