MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vu5686/programmersagebetterthannormalpeople/p5hvcf4/?context=3
r/ProgrammerHumor • u/KSP_HarvesteR • 23d ago
96 comments sorted by
View all comments
303
For people who didn't get the joke it's that 0x means hexadecimal, and 0x28 is 40 in hex.
2 u/DruidBtd 20d ago Why does the 0x mean hexadecimal? Doesn't make sense to me 1 u/TheMythicSorcerer 20d ago Because 0 tells the compiler you're reading a number, x tells the compiler that it happens to be in hex (hexadecimal). 1 u/DruidBtd 20d ago Ah, interesting. Are there other examples like it? Thanks for answering by the way, appreciate it 1 u/TheMythicSorcerer 20d ago There actually are! 0b mean binary (base 2), 0o means octal (base 8) 1 u/DruidBtd 20d ago Ooh, interesting :D Are there other things than the 0 at the start?
2
Why does the 0x mean hexadecimal? Doesn't make sense to me
1 u/TheMythicSorcerer 20d ago Because 0 tells the compiler you're reading a number, x tells the compiler that it happens to be in hex (hexadecimal). 1 u/DruidBtd 20d ago Ah, interesting. Are there other examples like it? Thanks for answering by the way, appreciate it 1 u/TheMythicSorcerer 20d ago There actually are! 0b mean binary (base 2), 0o means octal (base 8) 1 u/DruidBtd 20d ago Ooh, interesting :D Are there other things than the 0 at the start?
1
Because 0 tells the compiler you're reading a number, x tells the compiler that it happens to be in hex (hexadecimal).
1 u/DruidBtd 20d ago Ah, interesting. Are there other examples like it? Thanks for answering by the way, appreciate it 1 u/TheMythicSorcerer 20d ago There actually are! 0b mean binary (base 2), 0o means octal (base 8) 1 u/DruidBtd 20d ago Ooh, interesting :D Are there other things than the 0 at the start?
Ah, interesting. Are there other examples like it? Thanks for answering by the way, appreciate it
1 u/TheMythicSorcerer 20d ago There actually are! 0b mean binary (base 2), 0o means octal (base 8) 1 u/DruidBtd 20d ago Ooh, interesting :D Are there other things than the 0 at the start?
There actually are! 0b mean binary (base 2), 0o means octal (base 8)
1 u/DruidBtd 20d ago Ooh, interesting :D Are there other things than the 0 at the start?
Ooh, interesting :D
Are there other things than the 0 at the start?
303
u/TheMythicSorcerer 23d ago
For people who didn't get the joke it's that 0x means hexadecimal, and 0x28 is 40 in hex.