compare strings, strcmp

Mats Luthman matsl at nada.kth.se
Tue Nov 21 19:34:59 AEST 1989


In article <5139 at mnetor.UUCP> lazer at mnetor.UUCP (Lazer Danzinger) writes:
>+>In article <11605 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>+>>#define	StrEq( a, b )	(*(a) == *(b) && strcmp( a, b ) == 0)	
>+>>/* UNSAFE */
>+
>    I see no possibility of side effects. What is unsafe is the
>    referencing of the location where a and b point to, without
>    first checking that they are not null pointers. 

Try StrEq(foo--, bar--)



More information about the Comp.lang.c mailing list