ENSC 104: DIGITAL COMPUTER PROGRAMMING
C++ ENVIRONMENT
Readings: Pages 13-15
- Edit - Programs are created in the editor and stored on disk. In BC++,
File->New will create a new file to edit a program. File->Open will open an
already existing file for you to do more editing. File-Save As will allow you to save the
current file under a different name. Now you will have two copies of the program under two
different names.
- Preprocess - The preprocessor is the first step in compiling a C++
program. The preprocessor evaluates all statements that begin with a "#" sign.
For example "#include <iostream.h>".
- Compile - The compiler accepts an ASCII file, pgm1.cpp, as input and
converts it to object code, pgm1.obj. The output file, pgm1.obj, is commonly referred to
as an object module.
- Link - The linker combines or links the object code with all the
libraries built into C++ and creates and executable, pgm1.exe, stores this file back out
on disk.
- Load - The Loader places the executable from the Link step and places
this file into primary memory getting it ready to be executed.
- Execute - The CPU takes each instruction from primary memory and
executes that instruction and then fetches the next instruction. The "fetch and
execute" is repeated throughout the execution of the program.