I'm trying to use isalpha, but for some reason it's not working and counting everything, including spaces and punctuation. I tried to use isupper||islower with the same results. Any ideas why this is happening or something else i can use instead. Thanks!
string txt = get_string ("Text: ");
int length = 0;
for (int i = 0; i < strlen(txt); i++)
{
if (isalpha(*txt))
{
length ++;
}
}
printf("%i letter(s)\n", length);