O'Reilly logo

C Programming: Visual Quickstart Guide by Marc Liyanage, Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and Including Header Files

Although it's feasible to write an entire advanced C program in a single source file, accomplishing that task would be unnecessarily tedious and edits would require more effort than otherwise necessary. By using the C preprocessor, you can break complex applications down into multiple files, while still retaining the same functionality.

The #include directive provides a mechanism for including the contents of another file while compiling a primary file. You've seen this many times with the stdio.h include.

Quite often, these included files are in separate source files that exist solely to provide function declarations, macro definitions, and other nonfunction code. These included files are called header files ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required