Different values compiling for what I believe should be the same code

Comments

3 comments

  • Avatar
    Steve Tulk

    Forgot to add. Both Crossworks tried were Linux versions

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    This is correct behaviour, a leading zero indicates an octal literal in C/C++ ( http://en.cppreference.com/w/cpp/language/integer_literal ).

    0
    Comment actions Permalink
  • Avatar
    Steve Tulk

    Thank You for clearing that up!! I guess I should have realized that as I have come across 08 and 09 giving the error of Illegal Octal number and have had to code around that one for years. 

    0
    Comment actions Permalink

Please sign in to leave a comment.