Transforming source code to executable code in a Program:-

As you write and test your programs it will help if you remember to think about what it is that you are creating. You are creating a “recipe” for solving a problem and you are using a language that is meaningful to humans. Before this can be run on a computer it must be translated into a form that the computer can execute. The source code of the program must be translated into an executable version of the program.

This translation is a process called compilation. Compilation is actually a two-stage process. First the source code is translated into object code and then this object code is linked with various system libraries. The result of this linking is the final executable – a version of the program that is very different in the way it looks to the source code that you have written.

There are two steps in creating a program that can be run on a computer. First the source code must be created in a file; the name of this file will be required to have an extension that indicates that it contains a C++ program. When the program has been created it is compiled to produce an executable version; it is this version that can be run on the computer. This second process involves the use of two other pieces of software – a compiler and a linker. The compiler produces object code and the linker links this with the various C++ system libraries to produce a complete working executable version of the program.

There are several skills that you need to master in order to create and run your programs. You need to know how to create files and you need to know how to edit them. You must be able to compile your programs and correct the errors that the compiler finds. Finally, you must know how to run the executable and how to find the output. Unfortunately these skills differ depending on different computer systems; your Local guide will give you the details for your system.

To do any of these things you need to know how to write a simple C++ program. So it’s nearly time to get on with it. But first there are some things you need to know about learning to program.