Why is n
in
const int n = -0123;
an octal literal? I thought that all octal literals had to start with a 0, and this one doesn't since it starts with a negative.
It's a small point I know but It's causing me great confusion!
How is it possible that an octal literal can be negative?
There are no negative integer literals, only positive. The literal here is 0123 which does start with a 0 and is thus octal. -
in that expression is the unary minus operator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With