0

if we use 'num++' instead of 'num = num+1' what hppened

9th Jul 2016, 10:43 AM
Avinash
Avinash - avatar
7 Answers
+ 1
it the same thing num++ jst saves your time
3rd Jan 2017, 10:26 AM
Noel Omorodje
Noel Omorodje - avatar
+ 1
'++num' is faster :-) The ++ operators were once introduced to have a increment operator that maps to a single machine instruction. This might not be the case anymore but there's still a difference in non-optimized code. postfix ++ ('num++') and 'num=num+1' require a temporary to be constructed. '++num' doesn't. That's why it's faster.
9th Jul 2016, 11:44 AM
Stefan
Stefan - avatar
0
'num++' is faster.
9th Jul 2016, 11:03 AM
sHiZz
0
ie the fn of both is same
9th Jul 2016, 11:06 AM
Avinash
Avinash - avatar
0
both are similar..but code lengh reduced.
11th Jul 2016, 5:57 AM
Selva Subha Sree
0
the same
24th Dec 2016, 6:42 PM
Nathan
Nathan - avatar
0
they r both same.its like L.H.S=R.H.S.
26th Jan 2017, 2:45 AM
Ajit Sinha
Ajit Sinha - avatar