Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!taumet!mike From: mike@taumet.com (Michael S. Ball) Newsgroups: comp.lang.c++ Subject: Re: Turbo C++ and cout Message-ID: <283@taumet.com> Date: 1 Jul 90 16:02:55 GMT References: Reply-To: mike@taumet.UUCP (Michael S. Ball) Distribution: comp Organization: Taumetric Corporation, San Diego Lines: 21 In article chin@sg1.chem.upenn.edu (Chin Wu) writes: >Following codes behave differently in Turbo C++ and G++. I am not so >sure is this difference due to different version of stream used in >these two compilers or is it a bug in Turbo C++. : : >Turbo C++ output : 100 > 200 >G++ output : 100 > 10 The result of the code depends on the order in which different parts of an expression are evaluated. That order is undefined, and code which depends on evaluation order is highly non-portable. We seem to go through this periodically in these newsgroups. I am tempted to say that all compilers should warn about these situations just to reduce traffic on usenet. (Ours doesn't, but I'm getting very tempted.....) Mike Ball TauMetric Corporation mike@taumet.com