Below is a sample sourecode demonstrating how to convert or cast int to char in C#
Convert or cast integer to character in C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { internal class Program { // Abundantcode - function to convert int to char private static void Main(string[] args) { byte Input; char Output; Input = 65; // 65 is the Ascii code for A Output = (char)Input; Console.WriteLine("Result = " + Output); Console.ReadLine(); } } }
Leave a Reply