When building a project in C++,
you’ll usually create it by bringing together a lot of different types
(data structures with associated functions). You’ll usually put the
declaration for each type or group of associated types in a separate header
file, then define the functions
for that type in a translation unit. When you use that type, you must include
the header file to perform the declarations properly.
Sometimes that pattern will be followed
in this book, but more often the examples will be very small, so everything
– the structure declarations, function definitions, and the
main( ) function – may appear in a single file. However, keep
in mind that you’ll want to use separate files and header files in
practice.