Initialize char with int

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

Hi!

In C++ you could easily intialize a char-variable with an integer value:
char ch = 123;

How can we accomplish this in C#?
You can get the integer representation of a char value easily, but what
about the opposite?

TIA,

Markus
 
msnews.microsoft.com said:
In C++ you could easily intialize a char-variable with an integer value:
char ch = 123;

How can we accomplish this in C#?

char ch = (char)123;
 
Back
Top