Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!netnews.upenn.edu!chin From: chin@sg1.chem.upenn.edu (Chin Wu) Newsgroups: comp.lang.c++ Subject: Turbo C++ and cout Message-ID: Date: 1 Jul 90 06:54:12 GMT Sender: news@netnews.upenn.edu Distribution: comp Organization: University of Pennsylvania, Philadelphia, PA Lines: 26 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++. ------------------- #include --> change to #include in Turbo C++ int test(int& x) { x = 10; return 100; }; main() { int x = 200; cout << test(x) << '\n' << x << '\n'; }; --------------------- Turbo C++ output : 100 200 G++ output : 100 10 --------------------- -- chin@sg1.chem.upenn.edu