C++ (like its ancestor, C) separates definitions from implementations. Whereas a Java class is defined and implemented in one file, a C++ class or function is typically defined in a header file (with the extension
.hpp) and implemented in a source file (with the extension
.cpp). The header contains a full interface specification that other headers and source files might need in order to implement or use the class. Often, multiple files depend on a given header and, thus, the header will be imported multiple times from multiple files. We must manually ensure that the class is defined just once, regardless of how many times its header is imported. To achieve this, we wrap our class definition (or other ...