Mail Archives: djgpp/1997/03/16/22:48:40
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 -