Taking the question in its widest context, yes. That is, I can think of
one reason why one might not want to include headers in a C program.
Whether it's a *good* reason is another matter - I've heard opinions
both ways.
The context in which this reason is relevant is that of a C tutorial.
To the beginner, C has certain similarities to line noise. I still
remember trying to get a handle on C from a (ghastly) little yellow
paperback by Noel Kantaris, and the two things I struggled most with at
first were #include and #define. The rest seemed to make some kind of
sense, but those two just looked like gibberish.
A case can therefore be made for omitting headers from the early stages
of a tutorial work. One would begin by explaining main():
int main(void)
{
return 0;
}
which, of course, needs no headers anyway. One would then move on
immediately to explaining functions:
int foo(void)
{
return 6;
}
int main(void)
{
foo();
return 0;
}
(Obviously one would explain that, *for now*, we are not bothering to
use the return value of foo. Etc, etc, etc. I'm handwaving over a lot of
stuff here, because the only alternative would be to write the tutorial
right here!)
The author would no doubt stress that the control flow still starts at
main(), and that foo() is called at the appropriate time.
We're going to want to use a standard library function real soon now,
but first one would point out that the order of foo() and main() can be
changed around, *provided* that the compiler is granted a quick peek at
the nature of foo(), like this:
int foo(void);
int main(void)
etc etc.
A quick chat about prototypes would follow, and then the author would
mention standard library functions. Before long, example programs would
begin to look something like this:
int getchar(int);
int putchar(int);
int main(void)
{
int ch;
while((ch = getchar()) > 0) /* yeah, I know... */
{
putchar(ch);
}
return 0;
}
and would get progressively more complicated. At some point, one would
then say (on behalf of the reader): "but wait a minute - all this
'furniture' at the top of our programs is pretty much the same every
time; isn't there some way to say to the compiler 'just take it as read
that I've got all this standard stuff in the program'?"
And at that point, it becomes natural to introduce #include.