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
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…