Tuesday, March 6, 2012

Assigning integer to character is perfectly allowable in Java, C/C++

char c = 65; // Java, C/C++ would allow this. C# won't
System.out.println(c); // outputs A



need to typecast in C#
char c = (char) 65;
Console.WriteLine(c);

No comments:

Post a Comment