Inspiring from a obfuscated piece of code, I have a small question regarding to assign value to an integer:
#include <iostream>
#include <cstdio>
int main() {
int i = 0101;
std::cout << i << "\n";
}
And the output was 65, and I have no idea where 65 came from? Any idea?
It specifies an octal (base-8) number: 0101 == 1 * (8 * 8) + 1 == 65
.
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