tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: [OT] of the different methods to get a user-id
Date Mon, 16 Feb 2009 22:19:23 GMT
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Subject: Re: [OT] of the different methods to get a user-id
>
> For instance.
> i = i++
>
> yields different results depending on what language
> you are using. C and Java produce different outputs
> (which really surprised me!).

Java explicitly defines the behavior of the above statement, whereas the C standard does not,
and leaves it up to the implementation to decide what to do.  However, on almost every platform
I have access to right at this moment (Windows, Linux, proprietary), printing the value of
i after your test statement in both C and Java displayed the original value of i (as expected),
not the increment thereof.  The one problematic environment that gave the unexpected answer
was Visual C++ 6.0 on Windows (gee, Microsoft ignores standard practice? who would a-thunk
it); gcc on Windows worked properly.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message