Syntax error. You just need to change it to the correct syntax.
do
{
...
} while(isalpha(n));
The isalpha() function takes a parameter (inside the parentheses). That's what will be checked whether it is a letter.
That will fix your compile error with isalpha. But there are still problems with the code.
First, what is this about? char n = '\1';
If you're trying to set n equal to the character 1, then it should be char n = '1';
without the backslash. If you're trying to set it to a value of 1, then you should use char n = 1;
It is allowable to use a char variable as a counter, since C treats it like a one byte signed integer as well as a char.
But, if you're really trying to count characters, why not just use count_letters directly?
Finally, the do/while loop is a problem. As written, it will do one of two things. It will either execute exactly once because n is not a letter, or it will run as an infinite loop because n is a letter, and nothing inside the loop will ever change the contents of n.
You should look at doing that for loop again! ;-)
That should get you over some of your issues, and let you keep working, as you requested.
Happy programming! ;-)
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)