Putc : Write Single Character to specified Stream

March 27, 2010 No Comments » Hits : 138






Putc : Write Single Character to specified Stream

Syntax :
#include<stdio.h>int putc( int ch, FILE *stream );

What it does ?
  1. It Writes Character onto the Stream.
  2. Its Return Value is Character Written on Stream.
  3. If any Error Occures then It returns EOF

Live Example :

#include<stdio.h>

int main(void) {   char msg[] = "Hellon";   int i = 0;

   while (msg[i])       putc(msg[i++], stdout);   return 0;  }

Output :
       Writes “Hello” Word to File Character by Character
Diagram :


Bookmark & Share

Incoming search terms: