can someone explain why a++ works in a string temp...
# getting-started
f
can someone explain why a++ works in a string template but not a+=1
t
a++
is an expression whose result is
a
, then
a
is assigned
a + 1
.
a +=1
is a statement. Just like an assignement, it does not return an expression and therefore is not assignable. Only expressions are allowed in string templates.
👆 1
f
ok thank you