Mail Archives: djgpp/1997/03/13/16:58:28
In article <33280F93 DOT B9B AT uxa DOT ecn DOT bgu DOT edu>, Andy Bober <muajb2 AT uxa DOT ecn DOT bgu DOT edu> 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
______________________________________________________________________________
- Raw text -