c – Allow the user to enter only with letters when registering.


Condition to only receive letters in that place

scanf ("% s", & name);

int check (struct reg list[], name[128]) {

int i;
for (i = 0; i <reg_size; i ++) {
if (! strncmp (list[i].name, name, 128))
return 1;
}
return 0;
}

void record (struct reg list[5]) {
int i;
(i = 0; i <5; ++ i) {
char name[128];
printf ("Enter the name:  n");
scanf ("% s", & name);
yes (strcmp (name[i] < '0' || nome[i] >    & # 39; 9 & # 39;); {
printf ("Enter a valid name");
}
(If not,
reg_size ++;
list[reg_size-1].id = reg_size;
strcpy (list[reg_size-1].name, name);
list[reg_size-1].cred = 0.0;
printf (" nUser% s created with id% d  n  n", list[reg_size-1].name, reg_size);
}
other
{
printf (" nName not available  n  n");
}
}