C JavaScript Arithmetic Trick
A lot of people don’t know this one weird trick — much like JavaScript, C also lets you perform arithmetic with mixed types: #include <stdio.h> int main() { puts("-0.5" + 1); } 0.5 You can do this for exponents, too! #include <stdio.h> int main() { printf("%d\n", 50 ** "2"); } 2500
Two fake programming posts demonstrate absurd C code that supposedly performs mixed-type arithmetic like JavaScript, printing 0.5 and 2500. The joke is that the code is intentionally nonsensical and impossible in standard C, parodying misleading programming “tricks.”
- @ithueti / 14647 2024-11-26
- Type
- image
- Size
- 580×800 · 62.9 KiB
- Mood
- absurd, sarcastic
- Language
- en
- Added