vulcan@uiuc.edu (EvilTwin) (06/21/91)
In article <902@adimail.UUCP> tel@adimail.UUCP (Terry Monks) writes: >(Peter van der Linden (linden@adapt.Eng.sun.com)) scripsit: >> >> q = q++; >> > >This strange statement does exactly what I expected it to do - it assigns to >q the value of q incremented - i.e. is the same as just q++. I actually compiled >it to make sure. > > >Terry "" Monks > The above has been shameless edited of all (most?) simmerage. A co-worker and I tried the above on our respective machines. He on an IBM 70/386 using Borland C++, I on a MicroVAX II using DEC's C version 3.1. He received a result of 6, I one of 5. Why is this? Does your chewing gum lose it's flavor on the bedpost overnight? Evil "Bring on the Terry's" Twin - ps - the initial value of q was 5.
jma@reef.cis.ufl.edu (John 'Vlad' Adams) (06/26/91)
In article <1991Jun25.151408.1024@ux1.cso.uiuc.edu> vulcan@uiuc.edu (EvilTwin) writes: >A co-worker and I tried the above on our respective machines. He on an IBM >70/386 using Borland C++, I on a MicroVAX II using DEC's C version 3.1. He >received a result of 6, I one of 5. >ps - the initial value of q was 5. My platform, an Amiga, with SAS C 5.10a, also generates a 5. Long live DECs and Amigas. :) -- John M. Adams --*****-- Professional Student /// Internet: jma@cis.ufl.edu Genie: vlad /// Only the Amiga Sysop of The Beachside, Amiga Support, StarNet BBS \\V// Makes it Possible Fido Net 1:3612/557. 904-492-2305 (Florida) \X/
rmp@crashnburn.Eng.Sun.COM (Richard Pottorff) (06/28/91)
In article <29378@uflorida.cis.ufl.EDU> jma@reef.cis.ufl.edu (John 'Vlad' Adams) writes: In article <1991Jun25.151408.1024@ux1.cso.uiuc.edu> vulcan@uiuc.edu (EvilTwin) writes: >A co-worker and I tried the above on our respective machines. He on an IBM >70/386 using Borland C++, I on a MicroVAX II using DEC's C version 3.1. He >received a result of 6, I one of 5. >ps - the initial value of q was 5. #My platform, an Amiga, with SAS C 5.10a, also generates a 5. #Long live DECs and Amigas. :) -- John M. Adams --*****-- Professional Student /// ^^^^^^^^^^^^^^^^^^^^ I would be too, but it doesn't pay enough :-) I tried this two ways on my Turbo Pascal Compiler at home. int q=0; printf("\nq=q++=%d", q=q++); q=q++=0; and: q=q++; printf("\nq=%d", q); q=1 I don't know what this proves. Ramblin Rick
tmkk@uiuc.edu (K. Khan) (06/29/91)
In article <15952@exodus.Eng.Sun.COM> rmp@crashnburn.Eng.Sun.COM (Richard Pottorff) writes: > >I tried this two ways on my Turbo Pascal Compiler at home. > ^^^^^^^^^^^^^^^^^^^^^ > >int q=0; >printf("\nq=q++=%d", q=q++); > >q=q++=0; > >and: > q=q++; > > printf("\nq=%d", q); > > q=1 You did? And it compiled?!?!?!?!?!?!? >I don't know what this proves. It proves that you don't know the difference between a Pascal compiler and a C compiler! ;-) ;-) ;-) ;-) ;-)