From owner-freebsd-hackers Thu May 29 20:11:15 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA25075 for hackers-outgoing; Thu, 29 May 1997 20:11:15 -0700 (PDT) Received: from phobos.illtel.denver.co.us (abelits@phobos.illtel.denver.co.us [207.33.75.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA25068 for ; Thu, 29 May 1997 20:11:12 -0700 (PDT) Received: from localhost (abelits@localhost) by phobos.illtel.denver.co.us (8.8.5/8.6.9) with SMTP id UAA03918; Thu, 29 May 1997 20:14:08 -0700 Date: Thu, 29 May 1997 20:14:06 -0700 (PDT) From: Alex Belits Reply-To: Alex Belits To: Steve Howe cc: freebsd-hackers Subject: Re: cc/gcc In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Thu, 29 May 1997, Steve Howe wrote: with cc/gcc, i get outputs of "1" and "0" respectively. why? > unsigned char a, b, c; > > a = 1; b = 1; c = 0; > c = a == b == 1 ? 1 : 0 ; printf(" %i\n", c); 1 == 1 == 1 1 == 1 1 > a='1'; b='1'; c = 0; > c = a == b == '1' ? '1' : '0'; printf(" %c\n", c); '1'=='1'=='1' 1 == '1' 0 -- Alex