c_cpp C - 错误句柄

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp C - 错误句柄相关的知识,希望对你有一定的参考价值。

/**
 * die - error handle function
 * @message:	info about the error
 *
 * Print error message and exit.
 *
 */
void die (const char *message)
{
	if (errno) {
		perror (message);
	} else {
		printf("ERROR: %s\n", message);
	}

	exit(1);
}

以上是关于c_cpp C - 错误句柄的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 在C ++中使用结构体的基本句柄的示例

c_cpp 种族错误测试

c_cpp cin防止输入错误

c_cpp 在c中使用goto进行错误处理

c_cpp 测试名称类型错误,如错误:'...'没有命名类型

c_cpp 一个基于宏的简单C错误记录器