Mail Archives: djgpp/1997/03/14/01:41:11
In article <01bc2fa7$9893d3c0$8c081ecb AT sly>, "Sly" <sly AT aussie DOT net> wrote:
>Paul Peavyhouse <pv AT cs DOT montana DOT edu> wrote in article
>> char *str;
>> if ( (str = getenv("DEM_PATH")) == NULL) {
>> printf("\"DEM_PATH\" environment variable not set\n");
>> exit(1);
>> }
>>
>
>That printf statement...is it a valid string in there? Shouldn't it be...
>printf("DEMPATH environment variable not set\n");
>Or are you trying to put backslashes around it? Like this...
>printf("\\DEMPATH\\ environment variable not set\n");
>Try these. They should work.
No, my printf statement IS perfectly legal (all I'm doing is have it
print quotes around the DEM_PATH...don't ask why, it just works). To prove my
point I have completely commented it out, and I still have the same error.
Here is a modified code:
DATAFILE *terra;
int main (int c, char **v)
{
terra = load_datafile("terra.dat");
char *str;
}
The funny thing is that if I write it as:
DATAFILE *terra;
int main (int c, char **v)
{
char *str;
terra = load_datafile("terra.dat");
}
...IT WORKS?!?!?! I can live with writing it this way, but I want to
know why the compiler pukes when I write it the other way. Can any help me
here? I'd appreciate it!
PV
______________________________________________________________________________
Paul Peavyhouse
http://www.cs.montana.edu/~pv
email: pv AT cs DOT montana DOT edu
______________________________________________________________________________
- Raw text -