Q:

Why am I able to use isspace() without including the required header?

Why does this code work:
    #include <stdio.h>

    int main()
    {
        int x = isspace(getchar());
        printf("%d", x);
        return 0;
    }

Whenever I enter whitespace isspace() returns 8 and when I don't, it gives 0.
Shouldn't this produce an error at compile time? I didn't add #include <ctype.h> at the top. So why this is allowed?

A:

You're seeing this because your compiler (sadly, still) supports implicit declaration of a function.
If you enable strict checking, you compiler should refuse to compile the code. On and above C99, the implicit function declaration has been made non-standard. (To add, hopefully, future versions of compiler will strictly disallow this, by default.) 

