unix
is 1 because of an implicit #define
in the compiler or the runtime environment.
Thus, and because a[b] == b[a] == *(a + b)
and thus 1["xy"] == "xy"[1]
, you get:
&unix["\021%six\012\0"]
points to"%six\012\0"
(unix)["have"] = "have"[1] = 'a'
,"'a'+"fun"-0x60" = "fun" + 1 = "un"
.
This leads you to printf("%six\012\0", "un");
which clearly does print "unix\012"
, \012
being a line break (the same as \n
).
If unix
is undefined, e. g. on a Windows system, you get an error.
If unix
was 0
(can that ever be the way on a clean system?), you get
printf("\012%six\n", 'h'+"fun"-0x60)
where the 2nd argument is "fun"+8
, pointing to Nirvana and leading to undefined behaviour.