pdf.css
Google


   


You are here: CodeIdol > C++ > Borland C++ Builder: The Complete Reference > page: 35 36 37 38 39 40 41 42 43 44 45


9
THE
FOUNDATION
OF
C++
Compilers Versus Interpreters
It is important to understand that a computer language defines the nature of a program
and not the way that the program will be executed. There are two general methods by
which a program can be executed: it can be compiled or it can be interpreted. While
programs written in any computer language can be compiled or interpreted, some
languages are designed more for one form of execution than the other. For example,
Java was designed to be interpreted and C was designed to be compiled. However,
in the case of C, it is important to understand that it was specifically optimized as a
compiled language. Although C interpreters have been written and are available in
some environments (especially as debugging aids or experimental platforms), C was
developed with compilation in mind. Since C++ Builder is a compiler, you will be
compiling and not interpreting programs. Since the difference between a compiler
and an interpreter may not be clear to all readers, the following brief description will
clarify matters.

In its simplest form, an interpreter reads the source code of your program one line
at a time, performing the specific instructions contained in that line. This is the way
that earlier versions of BASIC worked. In languages such as Java, a program's source
code is first converted into an intermediary form that is then interpreted. In either
case, a run-time interpreter is still required to be present to execute the program.

A compiler reads the entire program and converts it into object code, which is a
translation of the program's source code into a form that the computer can execute
directly. Object code is also referred to as binary code or machine code. Once the
program is compiled, a line of source code is no longer meaningful in the execution
of your program.

In general, an interpreted program runs slower than a compiled program.
Remember, a compiler converts a program's source code into object code that a
computer can execute directly. Therefore, compilation is a one-time cost, while
interpretation incurs an overhead each time a program is run.

The Form of a C Program
Table 1-2 lists the 32 keywords that, combined with the formal C syntax, form the C
programming language as defined by the C89 standard. These are the keywords that
form the C subset of C++ and the ones that are supported by C++ Builder. Also shown
are 12 extended keywords added by Borland that may also be included in a C program.
Of course, using the extended keywords renders your program nonportable. (Additional
Borland extended keywords are defined for use with C++. See Part Three.)

All C keywords are lowercase. In C uppercase and lowercase are different: else is
You are here: CodeIdol > C++ > Borland C++ Builder: The Complete Reference > page: 35 36 37 38 39 40 41 42 43 44 45


ADBRITE ads links
   
Related tags







Popular Categories
Unix books and guides

AJAX popular information
C# language guides
Windows books and cookbooks

.......








Business Key Top Sites

be number one
rate your site




    С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.

    Русский Polski Francais Deutsch
    support sitemap terms

© CodeIdol Labs, 2007 - 2009