SIMPLE malloc & pointer question

Tim McDaniel mcdaniel at adi.com
Wed Aug 8 00:55:51 AEST 1990


diamond at tkou02.enet.dec.com (diamond at tkovoa) writes:

   In article <7206 at helios.TAMU.EDU> jdm5548 at diamond.tamu.edu (James Darrell McCauley) writes:

    >main() {
    >  int *a,*b;
   Initially, a and b are NULL pointers (do not point to anything usable).

K&R2, sec. A8.7, page 219:
   The initial value of an automatic object not explicitly initialized
   is undefined.

Not NULL (which is a definite value), undefined.  "a == NULL" need not
be true; in fact, it is permitted to cause a fatal fault.

In the referenced article, substitute "undefined" for "null".
--
"I'm not a nerd -- I'm 'socially challenged'."

Tim McDaniel
Internet: mcdaniel at adi.com             UUCP: {uunet,sharkey}!amara!mcdaniel



More information about the Comp.lang.c mailing list