Created
November 12, 2024 14:56
-
-
Save zwimer/9b95d756b23ef0171cdd4c8d3edefeb2 to your computer and use it in GitHub Desktop.
Revisions
-
zwimer created this gist
Nov 12, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #include <iostream> void f(bool b) { if (b == true) { std::cout << "true\n"; } if (b == false) { std::cout << "false\n"; } } int main() { char c = 2; bool * b = (bool*) &c; f(*b); } /* Without optimizations might print: true false */