If I have a string string foo
and I write foo += 27
, what gets appended to the string? Is it the character with the ASCII hex value 0x27 or with 0x1b?
Also, when I try foo += 0
, I get a compilation error saying ambiguous overload of += operator with a string and int. How come I don't get a compilation error with adding non-zero numbers, but I do get an error with zero?
If I first say int z = 0
and then foo += z
, I do not get an error. What causes the difference?