Re: "A diagram of C23 basic types"

Liste des GroupesRevenir à fs maths 
Sujet : Re: "A diagram of C23 basic types"
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.c
Date : 02. Apr 2025, 19:26:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsjvgu$2fpp1$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 02/04/2025 18:29, David Brown wrote:
On 02/04/2025 17:38, bart wrote:
On 02/04/2025 16:26, Muttley@DastardlyHQ.org wrote:

Never understood that in C++ never mind C. NULL has worked fine for 50 years.
>
And it's been a hack for 50 years. Especially when it is just:
>
   #define NULL 0
  The common definition in C is :
      #define NULL ((void*) 0)
 Some compilers might have an extension, such as gcc's "__null", that are used instead to allow better static error checking.
 (In C++, it is often defined to 0, because the rules for implicit conversions from void* are different in C++.)
 
>
You also need to include some header (which one?) in order to use it.
 <stddef.h>, as pretty much any C programmer will know.
This program:
   void* p = NULL;
reports that NULL is undefined, but that can be fixed by including any of stdio.h, stdlib.h or string.h. Those are the first three I tried; there may be others.
So it is not true that you need include stddef.h, nor obvious that that is where NULL is defined, if you are used to having it available indirectly.

Date Sujet#  Auteur
9 May 25 o 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal