Close but yet so far. It's not a char, it's a negative integer value that is specifically designed to not be represented as a char. That's why all of the functions that check individual characters...
Type: Posts; User: quzah
Close but yet so far. It's not a char, it's a negative integer value that is specifically designed to not be represented as a char. That's why all of the functions that check individual characters...
Since we are implementing sub-optimal switch variations, here's mine:
switch( isdigit( c ) )
{
case 0: case EOF: break;
default: a++; break;
}
switch( ispunct( c ) )
{
case 0:...
Don't start with code. Start with a description of the problem. Think about the description, and split the job into tasks. Split each job into smaller steps until you can't any further. Now think...
If you have been wrestling with it, I'm going to make a leap of faith here and assume that you actually have some code or pseudo code. Slap it in here and we'll see where you're stuck.
Quzah.