TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: All
from: Kurt Kuzba
date: 2003-09-08 01:44:06
subject: Pointers

From: kkuzba{at}centurytel.net
To: c_echo{at}yahoogroups.com

* Author: Bo Simonsen
BS>  Okay, and with pointers it's NULL.

    NULL is defined by implementation, but it is usually 0.  This
 bit here is from the stddef.h file for MSVC5.0.

MSVC-stddef.h>   #ifndef NULL
MSVC-stddef.h>   #ifdef __cplusplus
MSVC-stddef.h>   #define NULL 0
MSVC-stddef.h>   #else
MSVC-stddef.h>   #define NULL ((void *)0)
MSVC-stddef.h>   #endif
MSVC-stddef.h>   #endif

    The inclusion of the NULL macro in stddef.h is part of the
 standard, so it is easy to check your compiler to see if NULL is
 equal to zero.  It should be, but the standard does not specify
 that it is.  If you are faced with an unknown compiler, you can
 just look at stddef.h to see, or you can run a bit of code to
 find out.

/*   seenull.c  Public Domain test of the value of NULL   */
#include 
int main (void)
{
    char* test = NULL, buf[16];
    printf("test = %p.\n", test);
    fgets(buf, 16, stdin);
    return 0;
}

>  kkuzba{at}centurytel.net   http://home.centurytel.net/kkuzba/
>  'There's more than one passage here,' he whispered with an effort:

--- SoupGate-Win32 v1.05
* Origin: kkuzba{at}centurytel.net (2:292/516.666)
SEEN-BY: 633/267 270
@PATH: 292/516 854 140/1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.