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 .β¦