Compiling a Program

Most programs are written in high level languages like C, C++, Java, Visual Basic or Pascal. These languages are designed to be easy for people to read and hence the commands in these languages are often written in English, or variations on English like printf.

The commands that the computer can actually understand are much simpler than the commands used in high level languages. Furthermore, the commands that the computer can execute will be represented in binary, not using long English words. In order for a program to be generated from a high level language a translation process must occur, during which the high level commands are mapped to low-level binary that the computer can understand. This translation process is known as compilation. It is performed by a program called a compiler, such as Visual C++ or Turbo C++

***** Add specific instructions for the compiler used... *****

When using Visual Studio, go to the file menu and select new. Select the project tab and then select "Win32 Console Application". Type in a name for your project and select "ok". On the next dialog, select "A typical Hello World! application" and click "ok".

To run your project, you must first build it. You can then execute it. Both of these options are under the build menu.

The sample program will be repeated here for your convenience.

#include <stdio.h>

int main(int argc, char* argv[])
{

    printf("Hello world!\n");

    return 0;
}

Take me back to the example!


 home                      table of contents                      about