Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Pre vs Post Incrementing variables

by SavannahLion (Pilgrim)
on Sep 12, 2010 at 14:19 UTC ( [id://859852]=note: print w/replies, xml ) Need Help??


in reply to Re: Pre vs Post Incrementing variables
in thread Pre vs Post Incrementing variables

Well... In the samples I gave above, the C++ IDE I used was MS Visual Studio 8 (or 2005, whatever it wants to call itself now) which gave 2 2 (or 3 3 3 in your sample) in the default Debug mode. So I guess virtually add it to the list there.

It is, however, useful to know this about the compilers. I know the C family compilers have their own idiosyncrasies, I guess I'll put this on the pile things to note.

  • Comment on Re^2: Pre vs Post Incrementing variables

Replies are listed 'Best First'.
Re^3: Pre vs Post Incrementing variables
by cdarke (Prior) on Sep 13, 2010 at 08:18 UTC
    I have noticed differences in later .Net versions of Visual Studio. I did not have them to hand when I wrote the node, and didn't want to guess. It could be that there is optimisation even in Debug. Check the project settings?

    So far as I can tell though, the order of execution (in C) of parameters is not defined. The reason why VS 6.0 (Debug) executed them from right to left was because that is the order of the C calling convention, __cdecl.
      cdecl controls the order in which the arguments are placed on the stack, not the order in which they are evaluated. While it tends to suggest a certain evaluation order, one cannot rely on it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://859852]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2025-07-16 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.