www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/16/22:48:40

From: "Sly" <sly AT antispam DOT aussie DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP inconsistencies?
Date: 17 Mar 1997 02:55:59 GMT
Organization: Sly
Lines: 32
Message-ID: <01bc327f$4b0b5300$89081ecb@sly>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970313130930 DOT 6426F-100000 AT is> <33280F93 DOT B9B AT uxa DOT ecn DOT bgu DOT edu> <5g9pat$fac AT netra DOT montana DOT edu>
Reply-To: "Sly" <sly AT aussie DOT net>
NNTP-Posting-Host: max0ppp07.bne.aussie.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Paul Peavyhouse <pv AT cs DOT montana DOT edu> wrote in article
<5g9pat$fac AT netra DOT montana DOT edu>...
[SNIP]
>         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.

Again, same problem you had earlier.  Declaring a variable inside code is a
C++ thing, and illegal in standard C.  In C, ALWAYS declare ALL variables
BEFORE any code in the function.

P.S. I realise my mistake concerning the printf line now, and it is
correct.  Just hadn't seen that escaped quote for a long time, and had
forgotten it.  I did prompt some replies though.  8^)

-- 
TTFN
Sly (Steve)
sly AT aussie DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019