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

STRTOL(3C)

��������
strtol, atol, atoi - �������������� ������� �������� � ����� �����

���������

	long strtol (str, ptr, base)
	char *str, **ptr;
	int base;
	
	long atol (str)
	char *str;
	
	int atoi (str)
	char *str;

��������
����������� ������� strtol �������� ����� ����� ���� long, �������� �������� ��������, �� ������� ��������� �������� str. ������� ��������������� �� ������� �������, �������������� � ��������� �������� ���������. ��������� ���������� ������� [��. ������ isspace � ctype(3C)] ������������.

���� �������� ptr �� ����� (char **) NULL, �� � �����, �� ������� �� ���������, ������������ ��������� �� ������, ��������� ���������� ���������. ���� ����� ������������ �� �������, �� *ptr ��������������� ������ str � � �������� ���������� ������������ ����.

���� �������� base ����������� (� �� ����������� 36), �� �� ��������������� ��� ��������� ������� ���������. ����� ��������������� ����� ����� ��������� ���������� ����, ������� ������������, � ���� ��������� ����� 16, �� ������������ ���������� �������� 0x � 0X.

���� �������� base ����� ����, �� ��������� ������������ �� ������� �������� �������: ���� ����� ��������������� ����� ��������� ������ 0, �� ����� ��������� ������������, ���� 0x ��� 0X - �� �����������������, ���� ����� ������ ����� - ����������.

Atol (str) ������������ strtol (str, (char **) NULL, 10).

Atoi (str) ������������ (int) strtol (str, (char **) NULL, 10).

��. �����
ctype(3C), scanf(3S), strtod(3C).

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