| writeChar |
(Stream stream, int ch) |
yoix.io |
| |
Tries to write the character represented by
ch
to
stream
and returns the number of characters actually written,
which in this case should be 1, or
-1
if an error occurs.
| |
| Example: |
On a UNIX-like system the program,
import yoix.io.*;
File file;
int ch;
if ((file = open("/etc/passwd", "r")) != NULL) {
while ((ch = readChar(file)) != -1)
writeChar(stdout, ch);
close(file);
}
copies the system password file to standard output
one character at a time, so it is slow.
| | |
| Return: |
int
| | |
| See Also: |
write,
writeLine
|
|
Yoix is a registered trademark of AT&T Intellectual Property.
|