$ ./guess_the_languageProgramming Languages
Programming Languages · medium · #574

Which programming language is this?

union value {
    int i;
    float f;
    unsigned char bytes[4];
};
union value v;
v.f = 1.5f;
printf("%02x\n", v.bytes[0]);

Answer: C

A union whose members share the same memory, declared with union value v; and printed via printf, is C.
Play Programming Languages ▸