I wonder when I saw errors like invalid digit in octal constant 9 and 8.Also it print wrong value for the value of "mobno"(in structure) if zero is the first digit, but it give error when zero is used as first digit for num at the end of program.Is there someone who would explain it for me?
In addition to decimal numbers (those that most of us use every day), C++ allows the use of octal numbers (base 8) and hexadecimal numbers (base 16) as literal constants. For octal literals, the digits are preceded with a 0 (zero) character. And for hexadecimal, they are preceded by the characters 0x (zero, x). For example, the following literal constants are all equivalent to each other: