The Mechanics of Creating a Program

Suppose you've written a C++ program. How do you get it running? The exact steps depend upon your computer environment and the particular C++ compiler you use, but they will resemble the following steps (see Figure 1.3):

  • Use a text editor of some sort to write the program and save it in a file. This file constitutes the source code for your program.
  • Compile the source code. This means running a program that translates the source code to the internal language, called machine language, used by the host computer. The file containing the translated program is the object code for your program.
  • Link the object code with additional code. C++ programs, for example, normally use libraries. A C++ library contains ...

Get C++ Primer Plus, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.