putchar()

write a character to the standard output 

Function


SYNOPSIS

#include <stdio.h>

int putchar(int c);


DESCRIPTION

The putchar() macro is equivalent to putc(c, stdout). It writes a byte with value c, cast as an unsigned character, to standard output stream stdout. After putchar() returns, the character may be held in an internal buffer either until fflush() or fclose() are executed on stdout, or until the process executes exit() or abort().


PARAMETERS

c 

Is the character to be written.


RETURN VALUES

On success, putchar() returns the value c that it wrote to stdout. On failure, it returns EOF and sets errno to one of the following values:

EACCES 

Another process has the file locked.

EBADF 

stdout is not a valid stream opened for writing.

EFBIG 

The file is a regular file and an attempt was made to write at or beyond the offset maximum.

EINTR 

A signal interrupted the call.

EIO 

An output error occurred.

ENOMEM 

Memory could not be allocated for internal buffers.

ENOSPC 

An attempt was made to write to a full disk.

ENXIO 

A device error occurred.

EPIPE 

An attempt was made to write to a closed pipe.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

If stdout is associated with a file opened in text mode, linefeed is translated to carriage-return linefeed on output. No such translation occurs if stdout is opened in binary mode.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
abort(), exit(), fclose(), fflush(), fputc(), fputs(), putc(), putc_unlocked(), putchar_unlocked(), puts()


PTC MKS Toolkit 10.4 Documentation Build 39.