@[email protected] to Programmer [email protected]English • 1 year agogot himlemy.lolimagemessage-square133fedilinkarrow-up1497
arrow-up1497imagegot himlemy.lol@[email protected] to Programmer [email protected]English • 1 year agomessage-square133fedilink
minus-squarenelsonlinkfedilink3•1 year agoYes. p++ == p+= 1 == p = p + 1 are all the same if you use it in an assignment. ++p is different if you use it in an assignment. If it’s in its own line it won’t make much difference. That’s the point I was trying to make.
minus-square@[email protected]linkfedilink5•1 year agoNo. ++p returns incremented p. p += 1 returns incremented p. p = p + 1 returns incremented p. p++ returns p before it is incremented.
minus-squarenelsonlinkfedilink3•1 year agoRight. So i had them the other way around. :D Thanks for clarifying.
Yes.
p++
==p+= 1
==p = p + 1
are all the same if you use it in an assignment.++p
is different if you use it in an assignment. If it’s in its own line it won’t make much difference.That’s the point I was trying to make.
No.
++p returns incremented p.
p += 1 returns incremented p.
p = p + 1 returns incremented p.
p++ returns p before it is incremented.
Right. So i had them the other way around. :D
Thanks for clarifying.