LogiQuest
Back to Structures, Unions, Enums
14

What will be the output of the program?

#include <stdio.h>
union U { int i; unsigned char b[4]; };
int main(void) {
    union U u;
    u.i = 0;
    u.b[0] = 1;
    printf("%d\n", u.i != 0);
    return 0;
}
Hard

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.