delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/08/23:30:41

From: Paul Koning 1695 <pkoning AT chipcom DOT com>
To: djgpp mailing list <djgpp AT sun DOT soe DOT clarkson DOT edu>
Subject: RE: STRLEN(NULL)
Date: Thu, 08 Jun 95 22:28:00 PDT
Encoding: 10 TEXT

>Shouldn't strlen("") or strlen(NULL) return 0?

strlen("") should be zero.  strlen(NULL) is a program error, since you're 
not supposed
to pass a null pointer to it.  (A null pointer is something completely 
different
from a pointer to a null string.)

     paul

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019