In c++ this code would work:
char c='a';
int r=2;
c+=r;
This would do the same as c='c'
.
How can I do the same in c#?
Just cast it to char
before adding it to c
char c='a';
int r=2;
c += (char) r;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With