Google

Tuesday, June 3, 2008

To convert an INT into ASCII Char

Converting INTEGER into an ASCII char is very simple . In C# we dont need to do anything special, just type-cast the INT into a CHAR. int i = 65; char a = (char) i; Console.WriteLine("Result : "+a.toString()); Result : A Converting ASCII char into an INTEGER is also same way but vice versa.Type-casting CHAR into an INT. char a = 'A'; int i = (int) a; Console.WriteLine("Result : "+i.toString()); Result : 65

2 comments:

Anonymous said...

Thank you for your post, it's so easy to forgot the syntax.

Anonymous said...

i thank you too