MessageBox.Show

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all,

I have a int variable with the ASCII value 67 (the simbol C)
I would like to show the simbol "C" using this integer variable

Could you put me a little example?
 
You have an int variable, thats fine. You can cast it to a char...

char c = ((char) intVar);

There are many other useful utilities though.

Encoding.ASCII.GetString(new byte[] { (byte) intVar });
 
Hi Josema,

As Justin said, you can cast an int to a char.

int n = 67;
MessageBox.Show( ((char)n).ToString() );

Happy Coding!
Morten Wennevik [C# MVP]
 
Back
Top