#include <stdio.h>
#include <ctype.h>
int main()
{
char name[21];
printf("Please enter your name : ");
scanf("%s", &name);
if( isalpha(name) == 0)
printf("Invalid entry! please enter letters only.");
else
printf("Welcome %s", name);
return 0;
}
So, if the user enters a string, then the value of isalpha(name) is a non zero number. But the programme dint work out. and im wondering how do i fix this?
Your help is greatly appreciated.
Thanks.
This post has been edited by shangyi: 23 August 2008 - 08:35 AM

New Topic/Question
Reply



MultiQuote






|