C putchar()

« Previous Function Next Function »


The putchar() function writes the character contained in least significant byte of ch to the stdout. It is functionally equivalent to putc(ch, stdout). Because the character arguments are elevated to integer at the time of the call, you can use character values as the arguments to putchar().

putchar() Syntax

int putchar(int ch);

putchar() Example

Following loop writes to stdout the characters in string str. The null terminator is not written :

for(; *str; str++)

« Previous Function Next Function »