#include "error.h"
void myError(char *str)
{
char *msg = myStrError(errno);
printf ("%s: %s\n", str, msg);
}
char* myStrError(int num)
{
switch (errno)
{
case ERROR:
return "输入参数错误";
case MALLOC_ERROR:
return "malloc空间分配失败";
}
}
void myError(char *str)
{
char *msg = myStrError(errno);
printf ("%s: %s\n", str, msg);
}
char* myStrError(int num)
{
switch (errno)
{
case ERROR:
return "输入参数错误";
case MALLOC_ERROR:
return "malloc空间分配失败";
}
}