Mega Code Archive

 
Categories / C# / Data Types
 

To specify a hexadecimal constant, begin with 0x or 0X, followed by a sequence of digits in the range 0 through 9 and a (or A)

//Hexadecimal digits a (or A) through f (or F) represent values in the range 10 through 15.  using System; public class MainClass{     public static void Main() {         int i = 0x3fff;   // Hexadecimal constant         int j = 0X3FFF;   // Equal to i         Console.WriteLine(i);         Console.WriteLine(j);     } }