Click here to Skip to main content
14,422,081 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: postfix increment and decrement can get bent Pin
OriginalGriff4-Dec-19 0:20
communityengineerOriginalGriff4-Dec-19 0:20 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 0:24
mvahoney the codewitch4-Dec-19 0:24 
GeneralRe: postfix increment and decrement can get bent Pin
Jörgen Andersson4-Dec-19 6:30
communityengineerJörgen Andersson4-Dec-19 6:30 
GeneralRe: postfix increment and decrement can get bent Pin
Kornfeld Eliyahu Peter4-Dec-19 0:28
mveKornfeld Eliyahu Peter4-Dec-19 0:28 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 0:32
mvahoney the codewitch4-Dec-19 0:32 
GeneralRe: postfix increment and decrement can get bent Pin
F-ES Sitecore4-Dec-19 0:45
mveF-ES Sitecore4-Dec-19 0:45 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 1:11
mvahoney the codewitch4-Dec-19 1:11 
GeneralRe: postfix increment and decrement can get bent Pin
F-ES Sitecore4-Dec-19 1:27
mveF-ES Sitecore4-Dec-19 1:27 
"x = ++i" loads i onto the stack, pushes 1 onto the stack, adds them, duplicates the return (so two copies of i+1 are on the stack), pops one into i and one into x.

"x = i++" loads i onto the stack, duplicates it (so there are two copies of i on the stack), pushes 1 onto the stack, adds them (now there is i and i+1 on the stack), pops one into i and one into x.

Both operations involve three stack values and six operations so are no more or less efficient than each other.
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 1:47
mvahoney the codewitch4-Dec-19 1:47 
GeneralRe: postfix increment and decrement can get bent Pin
F-ES Sitecore4-Dec-19 2:05
mveF-ES Sitecore4-Dec-19 2:05 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 2:18
mvahoney the codewitch4-Dec-19 2:18 
GeneralRe: postfix increment and decrement can get bent Pin
F-ES Sitecore4-Dec-19 2:24
mveF-ES Sitecore4-Dec-19 2:24 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 2:38
mvahoney the codewitch4-Dec-19 2:38 
GeneralRe: postfix increment and decrement can get bent Pin
F-ES Sitecore4-Dec-19 3:51
mveF-ES Sitecore4-Dec-19 3:51 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 3:52
mvahoney the codewitch4-Dec-19 3:52 
GeneralRe: postfix increment and decrement can get bent Pin
F-ES Sitecore4-Dec-19 3:55
mveF-ES Sitecore4-Dec-19 3:55 
GeneralRe: postfix increment and decrement can get bent Pin
harold aptroot4-Dec-19 0:33
Memberharold aptroot4-Dec-19 0:33 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 0:34
mvahoney the codewitch4-Dec-19 0:34 
GeneralRe: postfix increment and decrement can get bent Pin
Daniel Pfeffer4-Dec-19 0:37
professionalDaniel Pfeffer4-Dec-19 0:37 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 0:38
mvahoney the codewitch4-Dec-19 0:38 
GeneralRe: postfix increment and decrement can get bent Pin
W Balboos4-Dec-19 1:57
mveW Balboos4-Dec-19 1:57 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 2:17
mvahoney the codewitch4-Dec-19 2:17 
GeneralRe: postfix increment and decrement can get bent Pin
lw@zi 4-Dec-19 3:11
professional lw@zi 4-Dec-19 3:11 
GeneralRe: postfix increment and decrement can get bent Pin
honey the codewitch4-Dec-19 3:16
mvahoney the codewitch4-Dec-19 3:16 
GeneralRe: postfix increment and decrement can get bent Pin
lw@zi 4-Dec-19 3:18
professional lw@zi 4-Dec-19 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.