Assert assert

#define	_CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
int main()
{
	int *p = NULL;
	assert(p != NULL);
	if (p == NULL)//断言失败下面程序将不会被执行
	{
		printf("p == NULL\n");
		return;
	}
	system("pause");
}

// result is as follows
Here Insert Picture Description
Here Insert Picture Description
assert is a macro

Guess you like

Origin blog.csdn.net/belongHWL/article/details/91040821