📄 errorp.cpp
字号:
/*********************************************************************
* Error Processing
*********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "GetData.h"
#include "types.h"
/*out**********************************************************
* Error messages
**************************************************************/
void Error(short n, char *s1, char *s2)
{
static char Messages=0; /* 记录系统出错的次数 */
printf("\nERROR: ");
switch(n) {
case 0:
printf("cannot open file %s%s\n", s1, s2);
exit(1);
case 1:
printf("':' expected after attribute name %s\n", s1);
break;
case 2:
printf("unexpected eof while reading attribute %s\n", s1);
break;
case 3:
printf("attribute %s has only one value\n", s1);
break;
case 4:
printf("case %d's value of '%s' for attribute %s is illegal\n", ItemNum+1, s2, s1);
break;
case 5:
printf("case %d's class of '%s' is illegal\n", ItemNum+1, s2);
}
if ( ++Messages > 10 ) {
printf("Error limit exceeded\n");
exit(1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -