Create int from hexadecimal literal in CSharp
Description
The following code shows how to create int from hexadecimal literal.
Example
//Hexadecimal digits a (or A) through f (or F) represent values in the range 10 through 15.
//from www . ja va 2 s . co m
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);
}
}
The code above generates the following result.