Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

STDIO(3S)

��������
stdio - ����������� ����� ��������������� �����/������

���������

	#include <stdio.h>
	
	FILE *stdin, *stdout, *stderr;

��������
������� � �������, ����������� � ������� 3S ����� �����������, ������������� ������������ ����������� �������� ��������������� �����/������. ������� getc(3S)putc(3S) ������ ��� �������� �����/������ ��������. ������� getchar � putchar � ������� ����� �������� ������ fgetc, fgets, fprintf, fputc, fputs, fread, fscanf, fwrite, gets, getw, printf, puts, putw � scanf ����� ���� ���, ��� ���� �� ��� ������������ getc � putc. ��������� � �������� � �������� �� ������� ������ ����� ���������� ������������ �������.

���� � ��������������� � ��� �������� ����������� ���������� �������. ����� ����������� ��� ��������� �� ���������� ���� FILE. ������� fopen(3S) ������� ��������� ������ � ���������� ��������� �� ����. ���� ��������� �������������� ����� �� ���� ����������� ���������. ������ ������� ��� �������� ������ � ����������� �����������, ��� ������� �� ���������� ����� <stdio.h> � ������� �� ������������ ��������� �������:

	stdin   ����������� ����
	stdout  ����������� �����
	stderr  ����������� ��������
��������� NULL (0) ���������� ������ ���������.

����� ��������� EOF (-1) ������������ �� ���������� ����� ����� ��� � ������ ������ ������������ �� ������������� �������, ���������� � �������� (��� ��������� ��������� ���������� ��. �������� ��������� �������).

����� ��������� BUFSIZ ������������� ������ �������, ������������ � ���������� ����������.

����� ���������, ������������ ������ ����� �����/������, ������ �������� ���� ��������������� ���������������� ��������� �������:

	#include <stdio.h>

������� � ���������, ����������� � ������� 3S ����� �����������, ������� � ����� <stdio.h> � �� ������� ����������� ��������. ��������� � ��������� "�������" ����������� ��� ������� (��������������� ���� ���� ������): getc, getchar, putc, putchar, ferror, feof, clearerr � fileno.

������ ������, �� ����������� ������������ ��������� stderr, �� ��������� ������������, ���� ����� ������������ � ����, � ������������ ���������, ���� ����� ������������ �� ��������. ����������� �������� stderr �� ��������� �� ������������, �� ������������� ������� freopen [��. fopen(3S)] �������� � ����, ��� ����������� �������� ���������� �������������� ��� �������������� ���������. ����� ����� ������ �� �����������, ������ ��������� � ������ ���� ��� �� �������� �� ���� ����������� �������� �� ������; ����� ����� ������ �����������, ����� ������������� � ������������ ������. ����� ����� ������ ����������� ���������, ������ ��������� ������ ��������� �� �������� ����� ���������� ������ (�� ���� ��� ������ ��������� ������ �������� ������ ��� ��������� ������ �� ���� � ���������). ������� setbuf ��� setvbuf [��. setbuf(3S)] ����� �������������� ��� ��������� ��������� ����������� �������.

��. �����
open(2), close(2), lseek(2), pipe(2), read(2), write(2), ctermid(3S), cuserid(3S), fclose(3S), ferror(3S), fopen(3S), fread(3S), fseek(3S), getc(3S), gets(3S), popen(3S), printf(3S), putc(3S), puts(3S), scanf(3S), setbuf(3S), system(3S), tmpfile(3S), tmpnam(3S), ungetc(3S).

�����������
������������ ��������� �� ����� ������ �������� � ������� ������������, ��������, � �������������� ���������. �������� ���������� ������� �������� ��� ������� ��������� ��������� ��������.
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT