|
|
coherent
putc() STDIO putc()
Write character into stream
#include <stdio.h>
iinntt ppuuttcc(_c, _f_p) cchhaarr _c; FFIILLEE *_f_p;
putc is a macro that writes a character c into the file stream
pointed to by fp. It returns c upon success.
***** Example *****
The following example demonstrates putc. It opens an ASCII file
and prints its contents on the screen. For another example of
putc, see the entry for getc.
#include <stdio.h>
main()
{
FILE *fp;
int ch;
int filename[20];
printf("Enter file name: ");
gets(filename);
if ((fp = fopen(filename,"r")) != NULL) {
while ((ch = fgetc(fp)) != EOF)
putc(ch, stdout);
} else
printf("Cannot open %s.\n", filename);
fclose(fp);
}
***** See Also *****
fputc(), getc(), putchar(), STDIO
***** Diagnostics *****
putc returns EOF when a write error occurs.
***** Notes *****
Because putc is a macro, arguments with side effects may not work
as expected.
COHERENT Lexicon Page 1
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.