Heroic failures (q = q++)
Richard Pottorff
rmp at crashnburn.Eng.Sun.COM
Fri Jun 28 08:52:39 AEST 1991
In article <29378 at uflorida.cis.ufl.EDU> jma at reef.cis.ufl.edu (John 'Vlad' Adams) writes:
In article <1991Jun25.151408.1024 at ux1.cso.uiuc.edu> vulcan at 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
More information about the Comp.lang.c
mailing list