int m_morales{9241}; // base 10: 0-9
int a_apaec{0x24CD}; // base 16: 0-9 and A-F
int m_gargan{0b10010000011001}; // base 2: 0-1
int b_reilly{022031}; // base 8: 0-7
// Leading with a 0 not the letter o.
You’re correct, 0x24CD is the only numeric literal in that section that does not have the value 9241.
But correcting it to 0x2419 would not show how a hexadecimal literal can contain digits in the range A .. F.
I’d rather have a value where the hexadecimal representation contains at least one digit in the range 0 .. 9 and at least one digit in the range A .. F.
Also, @vaeng often put pop-culture references into his texts. Here, the names of the variables evoke incarnations of a rather famous friendly neighborhood superhero across the ararchnid multiverse. I don’t know whether 9241 has a specific meaning in that context. If so, we should pick a suitable replacement.
It’s most probably just due to a typo when doing the conversion to hex: 0x24CD is 9421, so it’s like the other numbers with 4 and 2 swapped.
I agree that including a letter for the hexadecimal version is actually nice. How about instead of changing all numbers we leave 0x24CD as is and make the other three matching?
int m_morales{9421}; // base 10: 0-9
int a_apaec{0x24CD}; // base 16: 0-9 and A-F
int m_gargan{0b10010011001101}; // base 2: 0-1
int b_reilly{022031}; // base 8: 0-7
// Leading with a 0 not the letter o.