Is there a work around for invalid octal digit in an array?

Posted by sircrisp on Stack Overflow See other posts from Stack Overflow or by sircrisp
Published on 2012-04-04T23:23:29Z Indexed on 2012/04/04 23:28 UTC
Read the original article Hit count: 199

Filed under:
|
|
|
|

I'm trying to create an array which will hold the hours in a day so I can loop through it for a clock.

I have:

int hourArray[24] = {12, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 01, 02,
                     03, 04, 05, 06, 07, 08, 09, 10, 11};

I am getting the error on the following numbers in order 08, 09, 08, 09.

It tells me:

Error: invalid octal digit

I've never run into this before and I'm wondering if there is any way around it?

© Stack Overflow or respective owner

Related posts about c++

Related posts about arrays