Reputation: 35
I was just wondering this because I'm trying to store binary data in integers in C# like you can in Java by using the "0b" prefix.
Upvotes: 0
Views: 232
Reputation: 186668
Well, 0x
is 0x
:
int sample = 0xABCD;
As for binary, there's no equivalent, but you can do conversion:
int sample = Convert.ToInt32("1010", 2);
However, C# 6.0 probably will have 0b
prefix feature:
https://msdn.microsoft.com/en-us/magazine/dn683793.aspx
Upvotes: 3