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#?
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;