|
��������
assert - �������� ����������� � ���������
���������
#include <assert.h> assert (expression) int expression;
��������
������ ������ ������� ��� ��������� ����������� � ���������. ��� ���������� assert, ���� �������� ���������
expression - ���� (0), assert ������� � �����������
�������� ���������:
Assertion failed: expression, file xyz, line nnn
� �������� �����������. � ��������� �� ������ xyz - ��� ��� ��������� �����, nnn - ����� ������ � �������� ������, ���������� ������ �������� assert.
��� ���������� � ������ ������������� -DNDEBUG [��. cpp(1)] ��� � ����������� ���������� ������������� #define NDEBUG ����� ���������� #include <assert.h> ������� ��� �������� ����������� ���������� � ��������� �� �����.
��. �����
abort(3C).
cpp(1) � ����������� ������������.
�����������
��������� assert ���������� ��� ������, ���������
expression �� ����� ��������� ��������� ���������.
|