From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: FOUND DJP BUG. Date: Fri, 18 Apr 1997 21:56:11 -0700 Organization: Alcyone Systems Message-ID: <3358506B.49561597@alcyone.com> References: <3353E3F7 DOT 6369 AT tc DOT umn DOT edu> NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 31 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Jawed Karim wrote: > #include > > void main(void) > { > char *string = NULL; > > if (*string != NULL) > printf("\n%s\n", string); > } What you're doing here is dereferencing a null pointer, which is a Bad Thing To Do. If it crashes, it's your fault. If it doesn't, then it's still you're fault, but the compiler is not necessarily at fault. For what you appear to be trying to do, by the way, the correct statement is if (string != NULL) printf("\n%s\n", string); Your use of *string means you're dereferencing the pointer, which is null. Very naughty. -- Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com Alcyone Systems / web / http://www.alcyone.com/max/ San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W \ "The future / is right there." / Bill Moyers