Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!pilchuck!dataio!fnx!nazgul!bright From: bright@nazgul.UUCP (Walter Bright) Newsgroups: comp.lang.c Subject: Re: Finding NULL byte in a long Message-ID: <198@nazgul.UUCP> Date: 10 Dec 90 21:05:25 GMT References: <1990Dec5.033206.10463@nimbus3.uucp> Reply-To: bright@nazgul.UUCP (Walter Bright) Organization: Zortech, Seattle Lines: 9 In article <1990Dec5.033206.10463@nimbus3.uucp> djs@nimbus3.UUCP (Doug) writes: /I know this has been on the net before, since I thought I saved it, /but can't find it now. Anyway, could someone tell me what the /C expression is that tells you if a long has a NULL byte in it. /This is without masking each byte and testing it for 0. It is very /clever and non-obvious. Thanks. Hmmm, how about: p = memchr(&x,0,sizeof(x));