char name[50];
int valid;
do{
valid=1;
printf("Enter name for Salesman: ");
fgets(name,50,stdin);
if(!isalpha(*name)) //it will only scan for the first character of string
{
printf("Only alphabet is allowed.\n");
valid=0;
}
}while(valid==0);
我希望整个字符串没有任何数字输入。