minus-squareTyoda@lemm.eetoProgrammer Humor@lemmy.ml•got himlinkfedilinkarrow-up10·edit-26 months agoIn C an assignment is an expression where the value is the new value of what was being assigned to. In a = b = 1, both a and b will be 1. a = *(p = p + 1) is the same as p += 1 a = *p , so ++p. linkfedilink
minus-squareTyoda@lemm.eetoProgrammer Humor@lemmy.ml•got himlinkfedilinkarrow-up29·edit-26 months agoPerhaps *(p += 1) will be to your liking? linkfedilink
In C an assignment is an expression where the value is the new value of what was being assigned to.
In
a = b = 1
, both a and b will be 1.a = *(p = p + 1)
is the same as
, so ++p.