hello

my question would be if som1 can help out with a better prototype than i have for verifying if input is within ascii alphabetic range

what i have now

int betu (char s[]){
int i, jo=0;
for(i=0;i<strlen(s);++i)    {
if(!isalpha (s[i]) && s[i]!=' ' )
return 0;
else
++jo;
}
if(jo==strlen (s))
return 1; }

it gives 1 if sting is letter and space only , 0 if not

i like it because if my project says i musn't accept spaces , i can edit it very easily

however , when verifying a string with non ascii letters like "éíáúűáéóüö" my compiler (vs2010) will give me a kind error , i dont know about TC id be grateful if som1 checked it out tho . i dont need it to accept the non-ascii letters , english alphabet is ok , id be happy if som1 had an idea to make it stop giving an error

other than that it works fine and im very happy with it

Edited 5 Years Ago by TomaCukor: n/a

If you want to check for white space characters, you can use isspace() , which is in the same header file (ctype.h) that isalpha() is in.

Edited 5 Years Ago by ravenous: n/a

If you want to check for white space characters, you can use isspace() , which is in the same header file (ctype.h) that isalpha() is in.

yes , i already have that covered , im looking for an array solution , or maybe i should make a new one ....

Edited 5 Years Ago by TomaCukor: n/a

Since you seem to be getting answers that don't come close to a solution, maybe you need to describe again more clearly and in detail what you are trying to accomplish.

This article has been dead for over six months. Start a new discussion instead.