c primer plus中关于bool类型的使用

#include<stdio.h>
#include<stdbool.h>
#include<ctype.h>

int main()
{
    bool inword = false;
    float count;
    int word, letter;
    char ch;
    word = letter = 0;
    printf("Please enter the some words( EOF to quit):\n");
    while ((ch = getchar()) != EOF)
    {
        if (ispunct(ch))
            continue;
        if (isalpha(ch))
            letter++;
        if (!isspace(ch) && !inword)
        {
            inword = true;
            word++;
        }
        if (isspace(ch) && inword)
            inword = false;
    }
    count = (float)letter / word;
    printf("Total words:%d\n", word);
    printf("Total letter:%d\n", letter);
    printf("Average letter of the word:%g\n", count);
    return 0;
}

想问一下,定义bool inword为false,但是当getchar()读取到到第一个字母的时候,经过第三个if的时候,为什么判断为真

!isspace(ch) && !inword
读到的是字母,那isspace(ch)判断是否为空格结果一定返回false,!isspace(ch)就是true
inword是false, !inword就是true
两个true执行&&运算,结果就是true

isspace(),若判断字符ch为空空格、制表符或换行符,函数返回非零值,否则返回零值
当输入第一个字符为字母时,!isspace(ch) 为真,!inword也为真,所以第三个if判断为真