|
��������
gets, fgets - ������ ������� �������� �� ������
���������
#include <stdio.h> char *gets (s) char *s; char *fgets (s, n, stream) char *s; int n; FILE *stream;
��������
������� gets ������ ������� �� ������������ ������ ����� stdin � ������� ������, �� ������� ��������� �������� s. ������ ������������ �� ��� ���, ���� �� ���������� ������� ������ ��� ����� �����. ������ ��������
������ �������������, � ����������� ������� �������������� ������� ������.
������� fgets ��������� (n-1) �������� �� ������ ����� stream � ������� ������, �� ������� ��������� �������� s. ������ ������������ �� ��� ���, ���� �� ���������� ������� ������ (� ������� �� gets �� �� �������������) ��� ����� �����. ����������� ������� �������� �������������� ������� ������.
��. �����
ferror(3S), fopen(3S), fread(3S), getc(3S), scanf(3S),
stdio(3S).
�����������
���� ������ ����������� �������� �������� ������� �����
�����, �� ���� ���������� �� ������ ������� �� �����
�������, �� ��� ������� ���������� ������ ���������
NULL. ���� ���������� ������ ������, ��������, ��� ������� ������������ ��� ������� ��� ������, �� ��������
�� ������, �� ����� ������������ NULL. � ��������� ������� ������������ �������� ��������� s.
|