A
arnuld
i have just started to learn C++ from Bruce Eckel's book "Thinking in
C++ 2/e" & i am trying to understand the meaning of "j++". ++j is
pretty clear to me. i am using "g++" on my Debian Sarge.
here is the problem:
i = j = k = l = 0
++i -> --i = 0 ;; OK, fine
j++ -> j-- = 1 ;; WHAT?, why not 0
k++ -> k++ = 1 ;; WHAT?, why not 2.
l-- = -> l-- = -1 ;; why not -2
no i am not talking about efficiency/optimisation. i am talking about
the answers i got.
I searched archives but all i got is optimisations regarding the use of
++j & j++ but not regarding meaning of these. does anybody have any
idea? Bruce did not explain this behaviour in his book (except for a
single sentence)
thanks
"arnuld"
C++ 2/e" & i am trying to understand the meaning of "j++". ++j is
pretty clear to me. i am using "g++" on my Debian Sarge.
here is the problem:
i = j = k = l = 0
++i -> --i = 0 ;; OK, fine
j++ -> j-- = 1 ;; WHAT?, why not 0
k++ -> k++ = 1 ;; WHAT?, why not 2.
l-- = -> l-- = -1 ;; why not -2
no i am not talking about efficiency/optimisation. i am talking about
the answers i got.
I searched archives but all i got is optimisations regarding the use of
++j & j++ but not regarding meaning of these. does anybody have any
idea? Bruce did not explain this behaviour in his book (except for a
single sentence)
thanks
"arnuld"