Why is adding two char
in C# results to an int
type?
For example, when I do this:
var pr = 'R' + 'G' + 'B' + 'Y' + 'P';
the pr
variable becomes an int
type. I expect it to be a string
type with a value of "RGBYP"
.
Why is C# designed like this? Wasn't the default implementation of adding two char
s should be resulting to a string
that concatenates the char
s, not int
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…