book cover
book cover

You Can Do It!

A Beginner's Introduction to Computer Programming

by Francis Glassborow with Roberta Allen

Home      Contact Us      News & Updates

Glossary

If you do not find a word or phrase you think should be here, contact us and if we agree with you we will add it.


    A B C D E F G-I J-L M-N O-P Q-R S T U-Z

A
argument
The specific data provided for use by a function when it is called.
array
A fixed-size sequence container in which all the objects are kept in contiguous memory.
B
bits
A contraction of "binary digits" and refers to information stored as a series of zeros and ones.
block
A group of zero or more statements contained within a set of braces (also called a compound statement).
bug
A defect in a program that causes the resulting executable to fail in some way.
C
callback
A mechanism by which a function is provided with another function as one of its parameters to call when it is used. It allows us to tailor the behavior of a function at the point of use rather than at the point of definition. The various line-drawing functions that are part of my library and declared in line_drawing.h are examples of using a callback. Their last parameter determines what is to be done at each "point" of the line.
class
One of several mechanisms in C++ for creating a user-defined type.
compiler
A tool for converting source code into object code.
complete expression
An expression that is not part of a larger expression. For example in:
if(x == y+z) return;
x==y+z is a complete expression, y+z is an expression (but not a complete one), and strictly speaking so are x and y individually. Note that the whole line is a(n if-)statement and that return is a statement in its own right.
compound statement
A group of zero or more statements contained within a set of braces. A compound statement is also called a block. Note that a compound statement is itself a statement and so a compound statement can be part of a larger compound statement.
container
A type that is designed to hold zero or more objects of some type: associative containers contain objects in some specified order; sequence containers hold objects in an arbitrary order.
control variable
A variable whose value determines if a controlled statement is to be executed; typically, a variable declared in the first expression of a for-statement.
controlled statement
A statement or compound statement that is conditionally executed. For example, the body of a for-statement and the body of an if-statement are both controlled statements.
D
debugger
A tool to help a programmer locate logic errors in an executable.
declaration
A program statement that introduces a name into a region of program called a scope.
definition
The code that connects a name to an entity (object, function, type). Definitions are always declarations because they introduce names. Declarations do not have to be definitions because a name can be introduced and used before it is bound to an entity.
dynamic
Something or some property that is determined during the execution of a program.
E
enum
One of several mechanisms in C++ for creating a user-defined type. In this case, a simple integer type with one or more named values.
error
In the context of source code this refers to something that prevents the compiler or linker completing their tasks. Note that error-free code can be riddled with bugs. Errors prevent an executable being produced; bugs prevent an executable from behaving as intended.
executable
The result of compiling and linking a program to produce a freestanding entity that can be run on a suitable computer independent of the source code and tools used to produce it.
expression
An entity composed of values and operators that can be evaluated to produce a single value. For example i+3 and std::cin.get() are expressions but return std::cin.get(); is not because it has no value. However complete expressions that are not part of some larger statement are also statements (see statement).
F
free function
A function that is not a member function. This means that all its parameters are made explicit in its declaration and its use is not preceded by a variable and dot.
function
A set of instructions that is given a name. In general, a function returns an object and may be provided with data (arguments) when it is called (used). The arguments are used to initialize the function's parameters.
function declaration
A statement that specifies the name of a function, lists the types of data (the parameters) it will need when it is called and what type of value or object it will return when it finishes.
function definition
A function declaration that has been extended so that all the parameters are named and a compound statement (block of source code) that provides the function with its behavior has been provided.
fundamental type
see type
G-I
header
A file that contains the required declarations and definitions for using part of the C++ Standard Library (see also header file).
header file
A file that contains the declarations and definitions required for using object code provided by a user or a library. (That is, what is needed by a compiler to create object code that can be linked to other object code.)
high-level programming
Programming that does not need to consider aspects of the underlying hardware and operating system. This is the kind of programming that you have been doing as you study this book. C++ can be used for all levels of programming.
implementation
This term is often used as if it were a synonym for definition. There are times when that is true but there are other times when we use the terms with different meanings.
A definition in C++ is the code that provides an entity to which a name refers. An implementation is the detail of a definition where there are choices about the detail.
For example we would not speak about implementing a type when all we meant was the definition we place in a header file. However the details about the choice of data structures and the definitions of the member functions would be distinguished by being called an implementation of the type.
iterator
An object whose primary purpose is to locate another object (an iterator "remembers" where something is).
J-L
keyword
A word that is given a special meaning within C++ with the consequence that it may not be used as the name of anything. This is a stronger limitation than being a reserved word.
library
A collection of functions and user-defined types. The declarations and definitions that a compiler requires for use of a library entity is provided by one or more header files. In this book you use the C++ Standard Library and the FGW library directly. You also use the MS Windows GDI32 library indirectly because the implementation of the FGW library uses GDI32.
linker
A tool for combining files of object code with files of library code in order to produce an executable.
list
A sequence container with the property that every entry "knows" where to find the next entry. Lists where every entry 'knows' where the previous entry is are called bi-directional lists. The C++ list type is bi-directional.
literal
A pure value rather than a named object. 3, 5.6, -8.0 are numerical literals. 'a', 'C' and '\t' are examples of character literals. "Message", "This is a literal" and "\n" are examples of string literals. Note that character literals go in single quotes whereas string literals go in double quotes.
local variable
A variable that is either defined within the body of a function or is a parameter of the function.
low-level programming
Programming that uses direct access to machine-level features such as programs that are part of a machine's control systems.
M-N
map
An associative container that contains pairs of objects consisting of a key and a value. Objects can be located by using their key.
member function
A function that is declared in a class. It can only be applied to an object of that class type. The object used in the call of a member function is treated as an argument to an implicit parameter. For example, canvas.clear() passes the object named canvas to the member function called clear().
name
A group of letters, digits and some symbols. Each language has its own rules for what constitutes a valid name. In C++ a name may only contain upper and lower case letters, digits and an underscore ('_'). A name cannot begin with a digit. A user declared name (i.e. one introduced by the programmer) must not start with an underscore nor must it contain consecutive underscores.
namespace
A, usually named, region of an enclosing namespace in which declared names will be distinct from identical names declared elsewhere. The outermost namespace is the global space, which is always implicitly provided and has no name.
O-P
object
The entity that a variable names. In general, an object is a region of storage within a program executable. For example:
fgw::playpen canvas;
declares that canvas is a variable that refers to an object of type fgw::playpen.
object code
The result of processing source code with a compiler.
parameter
Declaration of the type of data that will be provided for a function when it is used.
pretty printing
The style of laying out source code with indents to highlight the structure of the code, for example, indenting the statements in a controlled compound statement.
private
The part of a class definition that is only available for use in the implementation of a class.
program
A complete collection of source code that a compiler can use to create an executable.
public
The part of a class definition that is available for general use.
Q-R
reserved word
A word or name that may not be declared or defined by an ordinary user (programmer) of C++. These words are available for use by those creating the C++ Standard Library.
return type
The type of data that will result from calling a function. The special case return type of void is the C++ way of specifying that no data will result from calling this function.
return value
The specific result of calling (or evaluating) a function.
S
scope
A region of program in which a name can be declared. Declarations of the same name in different scopes are distinct.
set
An associative container with the property that no two objects in it will compare as equal. In other words, a set does not contain multiple copies of objects.
source code
The instructions written in a computer language such as C++.
state
The pattern of bits that currently represent an object.
statement
The smallest unit of source code that exists by itself. Usually statements end with a semicolon. In many cases whether specific code is a statement depends on context. In effect, source code statements are the programming equivalent of sentences in natural language and expressions are the equivalent of clauses. Just as a sentence can consist of a single clause, statements can consist of a single expression. However some C++ statements can include sub-statements. For example: if(x==3) y=4; consists of two main expressions, x==3 and y=4. However the whole is an if-statement. These statements consist of a conditional expression (x==3) and a controlled statement (y=4). This is an example of a place where the same piece of code is simultaneously both an expression and a statement that is itself part of a larger statement.
static
Something that is done or known at compile time. As a keyword applied to a local variable it requires that the compiler allocate storage (memory) at an address that will remain fixed to that variable throughout each execution of the program. Note that this is not the case for other local variables, which are assigned storage just for the duration of each execution of the block in which they are defined. Note that there are other uses of static but they are not used in this book.
streams
Sources of and destinations for data. The main forms of streams are the console objects, file streams (where the source or destination is a file) and string streams (the source or destination is a std::string). Streams can be purely for input (sources of data), purely for output (destinations for data) or bi-directional.
T
text editor
A simplified word processor with which you can create and edit simple text suitable for the needs of a compiler.
type
A programming entity that has some specified behavior. It usually also has data that is specific to an instance of the type (see variable, object). Types have names. There are two major groups of types: fundamental types and user-defined types. In addition, a function in C++ has a type defined by its declaration. (this is one of several ways in which types can be implicitly compounded to create a new type). A fundamental type is defined directly by the programming language (C++ for this book); a user defined type is defined by a library (std:: and fgw:: types in this book) or directly by the programmer. An object type (as opposed to a function or expression type) has a definition that specifies how it stores data and what can be done with that data. It also has an implementation that instructs the compiler how to provide the required behavior. In general only the type's designer needs to be concerned with implementation. The programmer using a type only needs to understand the public part of its definition.
typedef
A mechanism for providing a new name for an existing type. Often used to clarify the use of a complicated type.
U-Z
unnamed namespace
A special mechanism whereby a group of declarations and definitions can be encapsulated so that they are only visible (and usable) from within the immediately encapsulating namespace. The names declared in an unnamed namespace are never visible outside the current file.
user-defined type
see type
using declaration
A statement that tells a compiler which namespace provides the declaration of a specified name so that the name can be used without a namespace prefix.
using directive
A statement that instructs a compiler to treat all the names declared in a namespace as if they had been declared at this point in the source code.
variable
A name that is used to refer to an object.
vector
A sequence container where all the objects are kept in contiguous memory.

© F. Glassborow & R. Allen 2003