Use putchar function to output character to standard output
Syntax
C putchar function has the following syntax.
int putchar(int ch);
Header
C putchar function is from header file stdio.h.
Description
C putchar function outputs character to stdout.
C putchar function returns the character written if successful or EOF on error.
Example
Write character to standard output using C putchar function.
#include <stdio.h>
int main(void){
// w ww . j av a 2s. c o m
char *str = "www.java2s.com";
for(; *str; str++){
putchar(*str);
}
}
The code above generates the following result.