Thread: Odd illegal digit errors

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582

    Odd illegal digit errors

    This is an error I've never seen until now and it doesn't make sense to me. Why am I getting it on this line:

    Code:
    SceneryXOffset[LoopCount] = 099385ll; SceneryOffsetStart[LoopCount] = 0; SceneryOffsetWidth[LoopCount] = 86; LoopCount++; // straw huts (3)
    I'm not providing extra lines as I have several such closely related things together. The ll (LL) is there for a reason - it's intended to be a 64-bit integer. The others are just regular 32-bit integers. This one line alone has 3 errors, of which I don't get:

    Code:
    1>.\Platform Masters.c(14616) : error C2041: illegal digit '9' for base '8'
    1>.\Platform Masters.c(14616) : error C2041: illegal digit '9' for base '8'
    1>.\Platform Masters.c(14616) : error C2041: illegal digit '8' for base '8'
    I've used lots of 64-bit integers without problems, so what's going on? How come the similar lines directly below have no problems?

    Code:
    SceneryXOffset[LoopCount] = 654373ll; SceneryOffsetStart[LoopCount] = 0; SceneryOffsetWidth[LoopCount] = 86; LoopCount++;
    SceneryXOffset[LoopCount] = 816026ll; SceneryOffsetStart[LoopCount] = 0; SceneryOffsetWidth[LoopCount] = 86; LoopCount++;
    ... // plus 21 more grouped up like this, none of which have any problems
    Thinking the leading zero is the culprit, how come this line works just fine, found 37 lines below the one without the error when the one being flagged does produce an error?

    Code:
    SceneryXOffset[LoopCount] = 051302ll; SceneryOffsetStart[LoopCount] = 0; SceneryOffsetWidth[LoopCount] = 86; LoopCount++;
    Any ideas? Thanks.
    Last edited by ulillillia; 07-22-2012 at 10:45 PM. Reason: 37 lines below, not 7.
    High elevation is the best elevation. The higher, the better the view!
    My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to display single digit int as four digit C++ Programming
    By Sloganathan in forum C++ Programming
    Replies: 1
    Last Post: 03-06-2012, 11:30 AM
  2. 3 errors(L value and illegal use of pointer)
    By ankitsinghal_89 in forum C Programming
    Replies: 4
    Last Post: 02-22-2009, 01:39 AM
  3. Illegal character errors
    By aama100 in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2008, 12:21 AM
  4. Adding a Large number digit by digit
    By mejv3 in forum C Programming
    Replies: 1
    Last Post: 09-14-2007, 03:28 AM
  5. Illegal operands, why the errors?
    By Kons in forum C++ Programming
    Replies: 9
    Last Post: 08-26-2003, 10:02 AM

Tags for this Thread