belamy

belamy

  • NA
  • 12
  • 0

octal numbers - how to use

Oct 8 2013 1:14 PM
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)