Menu

πŸ•΅οΈβ€β™‚οΈ The Case of the Vanishing Digits: Why 123,456 = 64?
πŸ“°

πŸ•΅οΈβ€β™‚οΈ The Case of the Vanishing Digits: Why 123,456 = 64?

DEV CommunityΒ·LaibaΒ·7 months ago
#QhjrQOYC
#cpp#beginners#softwareengineering#char#code
Reading 0:00
15s threshold

Ever had a piece of code do something so weird you thought your computer was possessed? πŸ‘»

Check out this C++ mystery:

char ch = 123456 ; cout << ( int ) ch ; // Output: 64 🀯

Enter fullscreen mode

Exit fullscreen mode

That is a great idea! Acknowledging the mentors who helped you understand a concept adds a nice personal touch and builds community. Since you're currently working through his DBMS playlist and following his roadmap, it fits perfectly.

Here is the updated version with a "Shoutout" section included at the end:

πŸ•΅οΈβ€β™‚οΈ The Case of the Vanishing Digits: Why 123,456 = 64?

Ever had a piece of code do something so weird you thought your computer was possessed? πŸ‘»

Check out this C++ mystery:

char ch = 123456 ; cout << ( int ) ch ; // Output: 64 🀯

Enter fullscreen mode

Exit fullscreen mode

Wait... what? Where did the other 123,392 go? Did the compiler steal them? πŸ’Έ

Actually, it’s all about "The Teacup Rule." β˜•

1. The Container Problem πŸ“¦

Think of a char as a tiny teacup .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.