Hi all,
i'm getting following error messege when i use

switch(temp.month)
{
//work fine with case 8:
case 08:
amonth=temp.day/30;
temp.day%=30;
temp.month+=amonth;
break;
default:break;
}
error:illegal digit  '8' for base '8'.

I can't understand why it is.could someone help me out asap.

Recommended Answers

All 2 Replies

Try typing 8 instead of 08

case 08:

and replace it by

case 8:

That is the only reason it is invalid

using the value 08 - the leading zero indicates it should be treated as an octal value (base 8 number), which has only the digits 0-7.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.