Sometimes a specific implementation of the C Standard Libraries will support one header by including another itself: in your case, stdio.h may be including - either directly or indirectly - the isspace
declaration, which might itself be directly in ctype.h
or in some other file that ctype.h
would include. You could test for this by executing just your preprocessing stage, as in...
gcc -E myprog.c | grep isspace
Another thing that can happen is that compilers hardcode implementations of common functions, like say strlen
, so they can e.g. perform it at compile time on string literals.
Despite it "working", you would ideally directly include the headers you'll need, so if another compiler/implementation - or a later release of the same - doesn't have the same quirks your code will still compile.