Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mimsy!eneevax!umd5!brl-adm!adm!DAVE%UWF.BITNET@wiscvm.wisc.EDU From: DAVE%UWF.BITNET@wiscvm.wisc.EDU Newsgroups: comp.lang.c Subject: Returning a value from ?: Message-ID: <7555@brl-adm.ARPA> Date: Wed, 27-May-87 22:57:43 EDT Article-I.D.: brl-adm.7555 Posted: Wed May 27 22:57:43 1987 Date-Received: Sat, 30-May-87 11:29:29 EDT Sender: news@brl-adm.ARPA Lines: 23 All, Well, my recent probs with printf are solved, by linking with LCM ahead of LC, as suggested. Thanks. Next in line, I just (yesterday) got a copy of Turbo C, and was trying out some old programs on it. It works mostly like a champ, but I ran across a small bug. It goes like this: (f(a) * f(p) > 0) ? (a = p) : (b = p); with the function f() being defined elsewhere, and with all things being defined as double. I got it to work by splitting up the ? : up into an if ... else, but it worked w/o hitch under Lattice 3.0. Is the above statement not valid C code? Should the result be put into a variable of some sort? I am aware of the philosophy that all expressions should return a value, and that the value returned should be referenced. So is Turbo just enforcing that, or should Borland have allowed it to pass with a warning? (No warning was generated, but the results of the code was strange until I cleaned it up.) Thanx, Dave (w/o a clue) Jaquay (DAVE@UWF.BITNET)