���������� �� C/C++
������� �������, ���� � ��������������� �����

����������� ���������� C/C++ �������� ��� �������, ���������� � ����� � ��������, � ����� �������, �������������� ��������������� ����������, ��������� � ����������. ������ ���� �������� � ��������� ������ �����.

� ����� � ������������� ������� ���� � ������� ������� ��������� ��������� <time.h>, � � ����� C++ � ��������� <ctime.h>. � ���� ����� ��� �������� ��������� ������������ ����� �-����������, �� ������ �� ��������� <time.h> � ��������������� ����� ����� �������� �������� �� ��������� <ctime.h>.

� ��������� <time.h> ���������� ��� ���� ������, ��������� � ����������� �������: clock_t, time_t � tin. ���� clock_t � time_t ������������� ��� ������������� ���������� ������� � ���� � ���� ���������� ������ ��������, ����������� ����������� ��������. ��� ��������� tm �������� ���� � ����� � ���� ��������� �� ��������. ����, ��������� tm �������� ��������� �����.

struct tm{
	int tm_sec;	//�������, 0-61
	int tm_min;	//������, 0-59
	int tm_hour;	//����, 0-23
	int tm_mday;	//���� ������, 1-31
	int tm_non;	//�����, ������� � ������, 0-11
	int tm_year;	//��� ����� 1900
	int tm_wday;	//����, ������� � �����������, 0-6
	int tm_yday;	//����, ������� � 1-�� ������, 0-365
	int tm_isdst	//��������� ������� �������
}

�������� tm_isdst ������������, ���� ��������� ����� ������� �������(Daylight Saving Time), ����� ����, ���� �� ���������, � ������������, ���� ���������� �� ���� ����������.

����� ����, � ��������� <time.h> ��������� ������ CLOCKS_PER_SEC, ������� ������ ���������� ������� ��������� ����� � �������.

��� ������ � ��������� ��������������� ����� ���������� ������������ � ����� � ��������� <locale.h>, � � ����� C++ � ��������� <clocale.h>. � ���� ���������� ���������� ��������� lconv, ������� ��������� � �������� ������� localeconv().

������ �������

asctime � ���������� ��������� �� ������, ������� �������� ���������� � ���� � �������
clock � ���������� ��������, ������� �������������� ������������� ����������������� ������� ������ ���������� ���������
ctime � ���������� ��������� �� ������, ������� �������� ���������� � ���� � �������
difftime � ���������� �������� �������� � �������� ����� ���������� �������� ����������
gmtime � ���������� ��������� �� ������������ ����� ��������� time � ���� ��������� tm
localeconv � ���������� ��������� �� ��������� ����, ������� �������� ��������� ���������� � ��������������� �����
localtime � ���������� ��������� �� ������������ ����� ��������� time � ���� ��������� tm
mktime � ���������� ���������� ������������ ������� �� ������ �������, ��������� � ������������ ���� � ��������� � ���������, ������� ���������� ���������� time
setlocale � ��������� ��������� ��� ���������� ������������ ���������, ������� ������� �� ��������������� ����� ���������� ���������
strftime � �������� ���������� � ������� � ����(������ � ������ �����������) � ������
time � ���������� ������� ����������� ����� �������






Нет комментариев.



Оставить комментарий:
Ваше Имя:
Email:
Антибот: *  
Ваш комментарий: