代码大全

(singke) #1
{

Employee[*EmployeeCount]=NewEmployee
(*EmployeeCount)++;
}
ReadEmployeeRec(NewEmployee);
}
/* do */
while(*EmployeeCount<MAX_EMPLOYEES&&!feof(EmployeeFile));
...
} /* ReadEmployeeData*/

ValidateEmployeeRec( ) ValidateInputField()


C
BOLLEAN ValidateEmployeeRec(EMPLOYEE Employee)
{
int FieldIdx;
int CharIdx;
FILE* EmployeeFile
Char TextChar
BOOLEAN ValidRecord;
int Length;


ValidRecord=TRUE;
for(FieldIdx=0;FieldIdxEmployee<Employee.NumFields;FieldIdx++)
{
length=strlen(Employee.Field[FieldIdx]);
for(CharIdx=0;CharIdx<Length;CharIdx++);
{
TestChar=EmployeeField[FieldIdx][CharIdx];
if(!
('a'<=Testchar&& Testchar< 'z'||
('A'<=Testchar&& Testchar< 'Z'||
'0'< Testchar&&Testchar<='9'))
ValidRecord=FALSE;
} / for /
} / for /
return(ValidRecord);

Free download pdf