Reading this answer which explains the polyglot program on page not found on Stack Overflow I was surprised to read putchar was used because you don\'t need a
In c, you can use any function without a declaration.
The compiler then assumes, that the function has a return type of int. The parameters are passed to the function as given. Since there is no function declaration, the compiler cannot verify, if the parameters are correct.
putchar is not builtin into the compiler. However, since
The function call putchar(c) shall be equivalent to putc(c,stdout).
it might be defined as a macro, e.g.
#define putchar(c) putc(c, stdout)
In this case, you must include stdio.h
to have the correct definition for putchar
.