RAD Studio
ContentsIndex
PreviousUpNext
fputc, fputwc

Header File 

stdio.h  

Category 

Input/output Routines 

Prototype 

int fputc(int c, FILE *stream); 

wint_t fputwc(wint_t c, FILE *stream); 

Description 

Puts a character on a stream. 

fputc outputs character c to the named stream.

Note: For Win32 GUI applications, stdin must be redirected.
Return Value 

On success, fputc returns the character c. On error, it returns EOF. 

Example  

#include <stdio.h>
int main(void)
{
   char msg[] = "Hello world";
   int i = 0;
   while (msg[i])
   {
      fputc(msg[i], stdout);
      i++;
   }
   return 0;
}

Portability

 
POSIX 
Win32 
ANSI C 
ANSI C++ 
fputc 
fputwc 
 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!