2

I have some problem with C# binary literals in Visual Studio. When I try to set some variable to binary literal I get syntax error CS1002 (need ';'). How to solve this problem? There is no problems with hexadecimal literals.

byte b = 0b00000000; // error

Screenshot of error

Screenshot of error

L_J
  • 2,351
  • 10
  • 23
  • 28
Kirill
  • 85
  • 5
  • It's looks like you are using old version of c#. `0b` literals are only available starting from version 7. More details in [this](https://stackoverflow.com/a/23546326/4685428) answer – Aleks Andreev Jun 30 '18 at 15:45
  • @AleksAndreev Okay, I will try to change my c# version. Thank you! :) – Kirill Jun 30 '18 at 15:50
  • Possible duplicate of [C# binary literals](https://stackoverflow.com/questions/594720/c-sharp-binary-literals) – Sнаđошƒаӽ Jun 30 '18 at 18:35

0 Answers0