Xref: news2.mv.net comp.os.msdos.djgpp:8445 From: frazer AT rtp DOT ericsson DOT se (Scott Frazer) Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with #define's under DJGPP Date: Mon, 09 Sep 1996 20:17:50 GMT Organization: Ericsson Data Services Americas Lines: 31 Message-ID: <511jai$rjt@cnn.exu.ericsson.se> References: <511bnh$nne AT tornews DOT torolab DOT ibm DOT com> NNTP-Posting-Host: pc340.rtp.ericsson.se To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp aron AT wallaker DOT torolab DOT ibm DOT com (Aron Wallaker) wrote: >I'm having a problem trying to use #define's in a header file to define >constants for use in my C code. Here's an example: >--File:STAR.H--------------------- >#define STARPOPULATION 0x200 >--FILE:STAR.C--------------------- >#include"star.h" >void main(void) >{ > int LocalStarPop = STARPOPULATION; // This works. > for(x=0;x < STARPOPULATION ; x++) // This doesn't, see below. > { > //whatever > } >} Your filename "star.c" implies this is a C file, yet you are using C++ type comments. Are you using the C++ compiler (or is this just a theoretical example)? My second question would be what is 'x' defined as? Trying to help, Scott