Help us and donate little Bitcoins to pay the server costs: 1AXLPuRUBYc1JczTW4XS65GL6oWjNP2Vt2

User Tools

Site Tools


Programming Reference/Librarys

Question & Answer

because of the inhumane working conditions at amazon in Germany, I will offer the Amazon app no more! (ARD Reportage)

Table of Contents


    int putc(int char, FILE *stream); 

put char into a stream.

C Sourcecode Example

 * putc example code
#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
int main( void )
  int c;
  FILE *stream, *destination;
  stream = fopen("test.txt", "r");
  destination = fopen("test_copy.txt","w");
  if (stream == 0 || destination == 0) { 
     perror("cannot open stream");
     return 1;
    c = getc(stream);
    while (c != EOF)
      putc(c, stdout);
      putc(c, destination);
      c = getc(stream); 
  return 0;

content of test.txt

Test example file for putc source code


  Test example file for putc source code

output of test_copy.txt

Test example file for putc source code

see also getc

c/stdio.h/putc.txt · Last modified: 2013/01/22 22:02 (external edit)

The new Question & Answer System is online and waiting for your Questions about Programming problems Impressum