Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!decwrl!shlump.nac.dec.com!tkou02.enet.dec.com!diamond From: diamond@tkou02.enet.dec.com (diamond@tkovoa) Newsgroups: comp.lang.c Subject: Re: Ternary Operator: (cond ? const_str : nonconst_str) legal? Message-ID: <1769@tkou02.enet.dec.com> Date: 4 Jun 90 06:04:45 GMT References: <000019B@cdis-1.compu.com> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 12 In article <000019B@cdis-1.compu.com> tanner@cdis-1.compu.com writes: > char nonconst_str[10]; > const char const_str[10] = "123456789"; > blunge = printf("%s\n", cond ? const_str : nonconst_str); It is legal. The expression (cond ? const_str : nonconst_str) has type (const char *). -- Norman Diamond, Nihon DEC diamond@tkou02.enet.dec.com Proposed group comp.networks.load-reduction: send your "yes" vote to /dev/null.