C and C++ do not require a program to be broken into multiple files, but it is often helpful to do so. These files may be compiled separately, which gives the main reasons to use them:
A multi-file program contains several code files (.c or .cpp) which contain the various executable code, and header (.h) files which are used to relate them. The code files use the #include directive to read the headers. The code files are compiled and combined by a link step. The header files are not compiled, except indirectly when the #include directive is performed.
To compile a multi-file C program, the compilation process is broken up into two steps. (The compiling system may handle this automatically, so it won't be obvious, but it gets done somewhere.)
This produces the file istack2.o (or istack2.obj on Windows), in the process reading the istack2.h file because istack2.cc includes it. The -c on the command tells the compiler that we're going to do the link part later, and it should produce the object file and stop. (By default, it performs the link process on the single file along with the standard libraries and produces an executable.)
This produces the istackuse2.o or .obj file. The istack2.h file is read again during the compile because istackuse2.cc also includes it.
This combines the object files into an executable called stackuse. The file names will usually differ on Windows, though the same operation is performed.