Smallest Undefined C Program
int main() { int x = 0; return ( x = 1) + (x = 2); }
A short C program initializes x to 0 and then returns the sum of two assignments to x in one expression. The joke is that the order of evaluation is undefined in C, so different compilers produce different results. It is shared as a programming reaction to compiler quirks, language-lawyer puzzles, and undefined behavior. EN: A short C program initializes x to 0 and then returns the sum of two assignments to x in one expression. The joke is that the order of evaluation is undefined in C, so different compilers produce different results. It is shared as a programming reaction to compiler quirks, language-lawyer puzzles, and undefined behavior.
- @ithueti / 16 2017-08-23
- Type
- image
- Size
- 319×132 · 6.3 KiB
- Mood
- absurd, technical
- Language
- en
- Added