From owner-freebsd-hackers Thu May 29 19:40:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA24082 for hackers-outgoing; Thu, 29 May 1997 19:40:42 -0700 (PDT) Received: from iceberg.anchorage.net. (root@iceberg.anchorage.net [207.14.72.150]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id TAA24075 for ; Thu, 29 May 1997 19:40:36 -0700 (PDT) Received: from aak.anchorage.net (ai-136 [207.14.72.136]) by iceberg.anchorage.net. (8.6.11/8.7.3) with SMTP id RAA22500 for ; Thu, 29 May 1997 17:38:10 -0800 Date: Thu, 29 May 1997 18:10:28 -0800 (AKDT) From: Steve Howe X-Sender: abc@aak.anchorage.net To: freebsd-hackers Subject: cc/gcc Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk with cc/gcc, i get outputs of "1" and "0" respectively. why? is this construct ABSOLUTELY incorrect, or is something else amuck? /*****************************************************************************/ #include "stdio.h" /*****************************************************************************/ void main (unsigned char argc, unsigned char **argv) { unsigned char a, b, c; a = 1; b = 1; c = 0; c = a == b == 1 ? 1 : 0 ; printf(" %i\n", c); a='1'; b='1'; c = 0; c = a == b == '1' ? '1' : '0'; printf(" %c\n", c); exit( 0 );} /*****************************************************************************/