ppuuttcc() -- STDIO Function (libc)

Write character into stream
#iinncclluuddee <ssttddiioo.hh>
iinntt ppuuttcc(_c, _f_p) cchhaarr _c; FFIILLEE *_f_p;

ppuuttcc() writes  character _c  into the  file stream to  which _f_p  points.  It
returns _c upon success.

_E_x_a_m_p_l_e
The  following example  demonstrates  ppuuttcc(). It  opens an  ASCII file  and
prints its contents on the screen.   For another example of ppuuttcc(), see the
entry for ggeettcc().

#include <stdio.h>
main()
{
    FILE *fp;
    int ch;
    int filename[20];

    printf("Enter file name: ");
    gets(filename);

    if ((fp = fopen(filename,"r")) != NULL) {
        while ((ch = fgetc(fp)) != EOF)
            putc(ch, stdout);
    } else
        printf("Cannot open %s.\n", filename);
    fclose(fp);
}

_S_e_e _A_l_s_o
ffppuuttcc(), ggeettcc(), lliibbcc, ppuuttcchhaarr()
ANSI Standard, section 7.9.7.8
POSIX Standard, section 8.1

_D_i_a_g_n_o_s_t_i_c_s
ppuuttcc() returns EEOOFF when a write error occurs.

_N_o_t_e_s
Because ppuuttcc()  is a  macro, arguments  with side effects  may not  work as
expected.
