fputc

Writes a character to the output stream

Local Servers:blocking
Remote Servers:blocking
Classification:ANSI
Platform:NLM
Service:Stream I/O

Syntax

  #include <stdio.h> 
    
  int fputc  (  
     int     c,   
     FILE   *fp);
  

Parameters

c
(IN) Specifies the character to be written.
fp
(IN) Points to the output stream.

Return Values

The fputc function returns the character written. If a write error occurs, the error indicator is set and fputc returns EOF. If an error occurs, errno is set.

Remarks

The fputc function writes the character specified by the argument c to the output stream designated by fp.

See Also

fclose, fgetc, fopen, fputs, putc, puts

fputc Example

  #include <stdio.h>  
   
  main ()  
  {  
     FILE    *fp;  
     int     c;  
     fp = fopen ("data.fil", "r");  
     while ( (c = fgetc (fp) ) != EOF)  
        fputc (c, stdout);  
     fclose (fp);  
  }