4
Answers

octal numbers - how to use

belamy

belamy

11y
2.1k
1
I searched huge part of documentations and forums but something is wrong with Visual Studio C# 2010. Maybe I'm wrong but see my code below:

I try to use octal number constants and assign them to "int" variable.

// variable definition
byte L;

// first octal number 021 (17-decimal)
   L = 021;
// After that line I see (on debug) L=21
// 021 was treated as decimal not octal !!!

// next test, octal number 056 (46-decimal)
   L = 056;
// and I see (on debug) L=56, again wrong !!!

Why????



Answers (4)
Next Recommended Forum