From: pv AT cs DOT montana DOT edu (Paul Peavyhouse) Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP inconsistencies? Date: Thu, 13 Mar 97 13:49:58 GMT Organization: Montana State University Lines: 43 Message-ID: <5g9pat$fac@netra.montana.edu> References: <33280F93 DOT B9B AT uxa DOT ecn DOT bgu DOT edu> NNTP-Posting-Host: esus.cs.montana.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <33280F93 DOT B9B AT uxa DOT ecn DOT bgu DOT edu>, Andy Bober wrote: >[snip] >It's your nested double quotes. How many strings are in the printf() >line? >Parse of printf() string: >"\" --- this starts and ends one null >terminated string >DEM_PATH\ --- this is a syntax error >" environment variable not set\n" --- this starts and ends a second >null terminated string >Try the line like this: >char *str; >if ( (str = getenv("DEM_PATH")) == NULL) { > printf("'DEM_PATH' environment variable not set\n"); > exit(1); >} >If you need to use the the backslashes as characters in the string, I >believe they must be doubled. ( ie. "\\DEM_PATH\\ environment variable >not set\n" ) NONONONONO, there is nothing wrong with the printf line. All it does is output a litteral '"' (double-quote) character. The problem actually occured in the line AFTER the snipped I posted where I said: char *str; if ( (str = getenv("DEM_PATH")) == NULL) { printf("'DEM_PATH' environment variable not set\n"); exit(1); } BITMAP *buffer; <-- Parse error on THIS line If I move BITMAP *buffer before the "if" statement, the compiler is all happy...WHY? Thanks anyway for the reply. PV ______________________________________________________________________________ Paul Peavyhouse http://www.cs.montana.edu/~pv email: pv AT cs DOT montana DOT edu ______________________________________________________________________________