reasonable language
in
which to express solution strategies
as
long
as
the
communication is entirely between people who speak English. Obviously,
if
you
wanted to resent your algorithm to someone who spoke only Russian, English would
no longer be an appro priate choice. English is likewise an inappropriate choice for
presenting an algorithm to
a
computer. Although computer scientists have been
working
on
this
problem for decades, understanding English
or
Russian
or
any other
human language continues to lie beyond the boundaries
of
current technology. The
computer would be completely unable to interpret your algorithm
if
it were expressed
in
human language.
To
make an algorithm accessible to the computer, you need to
translate it into
a
programming language. There are many progr amming languages
in
the world, including Fortran, BASIC, Pascal, Lisp, and
a
host
of
others.
In
this
text,
you will learn how to use the programming language C — the language that has
become the de facto standard
in
the computing industry over the last several years.
The programming languages listed above, including
C,
are examples
of
what
computer scientists
call
higher-level
higher-level
higher-level
higher-level
languages
languages
languages
languages
.
Such languages are designed to be
independent
of
the particular characteristics that differentiate computers and to work
instead with general algorithmic concepts that can be implemented
on
any computer
system. Internally, each computer system understan ds
a
low-level language that is
specific to that type
of
hardware. For example, the Apple Macintosh computer and the
IBM PC use different underlying machine languages, even though both
of
them can
execute programs written
in
a
higher-level language such a
s
C.
To
make it possible for
a
program written
in
a
higher-level language to run
on
different computer systems, the program must first be translated into the low-level
machine language appropriate to the computer
on
which the program will run. For
example,
if
you are writing C programs for
a
Macintosh, you will need to run
a
special
program that translates C into machine lang uage for the Macintosh. If you are using
the IBM PC to run the same program, you need to use
a
different translator. Programs
that perform the translation between
a
higher-level language and machine language
are called compilers
compilers
compilers
compilers
.
Before you can run
a
program
on
most computer systems, it is necessary to enter
the text
of
the program and store it
in
a
file
file
file
file
,
which is the generic name for any
collection
of
information stored
in
the computer
’
s
secondary storage. Every file must
have
a
name, which is usually divided into two parts separated by
a
period,
as
in
myprog.c
.
When you create
a
file, you choose the root
root
root
root
name
name
name
name
,
which is the part
of
the
name preceding the period, and use it to tell yourself what the file contains. The
portion
of
the filename following the period indicates what the file is used for and is
called the extension
extension
extension
extension
.
Certain extensions have preassigned meanings. For example, the
extension
.c
indicates
a
program
fie
written
in
the C language.
A
file containing
program text is called
a
source
source
source
source
file
file
file
file
.
The general process
of
entering
or
changing the contents
of
a
file is called editing
editing
editing
editing
that file. The editing process differs significantly between individual computer
systems, so it is not possible to describe it
in
a
way that works for every type
of
hardware. When you work
on
a
particular computer system, you will need to learn
how to cr eate new files and to edit existing ones.
You
can find
this
information
in
the