RAD Studio |  |

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

Copy Code

    #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) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!