A computer cannot understand our language that we use in our day to day conversations, and likewise, we cannot understand the binary language that the computer uses to do it’s tasks. It is therefore necessary for us to write instructions in some specially defined language like C++ which is like natural language and after converting with the help of compiler the computer can understand it.
A C++ compiler is itself a computer program which’s only job is to convert the C++ program from our form to a form the computer can read and execute. The original C++ program is called the “source code”, and the resulting compiled code produced by the compiler is usually called an “object file”.
Before compilation the preprocessor performs preliminary operations on C++ source files. Preprocessed form of the source code is sent to compiler.
After compilation stage object files are combined with predefined libraries by a linker, sometimes called a binder, to produce the final complete file that can be executed by the computer. A library is a collection of pre-compiled “object code” that provides operations that are done repeatedly by many computer programs.
Integrated Development Enviornment
Above Figure illustrates the process of translating a C++ source file into an executable file. You can peform entire process of invoking the preprocessor, compiler, and linker with a single action by using Integrated Development enviornment. These environments consist of a text editor, compiler, debugger, and other utilities integrated into a package with a single set of menus. Preprocessing, compiling, linking, and even executing a program is done by selecting a single item from a menu.
Following Figure shows a screen from the Microsoft Visual C++ IDE.
The best way to start learning a programming language is by writing a program. In next section, we'll discuss a program that displays message on monitor.