Glossary

This appendix contains definitions for the key terms you will see throughout the book. They are organized alphabetically. As you read each hour and see a term you do not recognize, you should be able to turn to this appendix and find out a little more.

A

Abstract data type (ADT)
This represents a concept (like shape) rather than an object (like circle). As the name implies, it is an abstract form.

Accessor methods
Methods used to access private member variables.

ANSI
The American National Standards Institute is a nonprofit company that acts as the guardian of standards within the United States. Most countries and many regions (for example, the European Union) have similar organizations. In some cases, those organizations are part of the government, but ANSI is not a governmental agency. Go to http://www.ansi.org for more information.

Arity
How many terms an operator takes. The possible values for a C++ operator’s arity are unary, binary, and ternary.

Array
A collection of objects all of the same type.

ASCII (American Standard Code for Information Interchange)
A system for encoding the characters, numerals, and punctuation used by many computers.

Assignment operator (=)
Causes the operand on the left side of the assignment operator to have its value changed to the value on the right side of the assignment operator.

B

Binary operator
An operator that takes two terms, such as a+b.

C

C++0x
The working title for the next version of the C++ language, scheduled for final release in late 2011.

Case sensitive
When uppercase and lowercase letters are considered to be different. (playerScore is not the same as PlayerScore.)

Class
The definition of a new type. A class is implemented as data and related functions.

Clients
Other classes or functions that make use of your class.

Comment
Text that does not affect the operation of your program, but which is added to instruct or inform the programmer.

Compiler
Software that can translate a program from human-readable form to machine code, producing an object file that will later be linked (see linker) and run.

Compiling
The first step in transforming code from a compiler into what is called object code in an object file (.obj).

Compound statement
Replaces a single statement with a series of statements between an opening brace and a closing brace.

Conceptualization
The core idea of the software project.

Constant
Data storage locations whose value will not change while the program is running.

Constant member function
A constant member function promises that it won’t change the value of any of the members of the class.

D

Data members
See member variables.

Data hiding
Hiding the state of a class in private member variables.

Decrementing
Decreasing a value by 1 (when applied to the –– operator).

Deep copy
Copies the values of member variables, and creates copies of objects pointed to by member pointers.

Default constructor
A constructor with no parameters.

#define

A command that defines a string substitution.

Doubly linked list
A linked list in which nodes point both to the next node in the list and also the previous node in the list.

Driver program
A test program.

E

Efficiency
An overworked topic where major changes to the program code are made to save minute amounts of time. Although you want to keep this in mind as you write programs, unless you are writing real-time systems (controlling medical equipment or missiles), you should let the compiler worry about the details of efficient code.

Encapsulation
Creating self-contained objects.

Enumerated constants
A named set of constants.

Exception
An object that is passed from the area of code where a problem occurs to the part of the code that is going to handle the problem.

Executable program
A program that runs on your operating system.

Expression
Any statement that returns a value.

F

Friend
Keyword to provide another class with access to the current class’s private member variables and methods.

Function
A block of code that performs a service, such as adding two numbers or printing to the screen.

Function declaration
Tells the compiler the name, return type, and parameters of the function.

Function definition
Tells the compiler how the function works; it is the body of the function.

Function parameter list
The list of all the parameters and their types, separated by commas.

G

Global variables
Variables accessible from anywhere within the program.

H

Heap
The area of memory left over after the code space, global name space, and stack are allocated. This is also known as the “free store” and is the source of memory dynamically allocated using new or malloc.

I

Implementation (also called class implementation)
The code and declarations of data within a class. This is the code that is accessed using the interface. This information is typically stored in a .cpp file and compiled into object or library form. In many cases, the interface (in the form of a header file) and the compiled code (object or library file) is provided and not the actual class code—which prevents it from being modified.

Incrementing
Increasing a value by 1 (when applied to the ++ operator).

Indirection
Accessing the value at an address held by a pointer.

Infinite loop
Doing the same thing again and again forever. This is the type of iteration that programmers strive to avoid.

Inheritance
Creating a new type that can extend the characteristics of an existing type.

Instantiation
Creating an object from a class, or a type from a template.

Interface (also called class interface)
The definition of data and methods that can be accessed by other classes and code. The interface tells how the code is used. This information is often stored in a header file and included into the using module.

Interpreter
An interpreter translates a program from human-readable form to machine code while the program is running.

ISO
International Organization for Standardization. An international standards body similar to ANSI. ISO is not a governmental agency. Go to http://www.iso.org for more information.

Iteration
Doing the same thing again and again.

L

L-value
An l-value is an operand that can be on the left side of an operator.

Library
A collection of linkable files that were supplied with your compiler, you purchased separately, or created yourself.

Linked list
A data structure that consists of nodes linked to one another.

Linker
A program that builds an executable (runnable) file from the object code files produced by the compiler.

Linking
The second step in creating an executable file; links together the object files produced by a compiler into an executable program.

Literal constant
A value typed directly into the program, such as 35.

Local variables
Variables that exist only within a function.

M

Member functions (also called member methods)
The functions of your class.

Member methods
See member functions.

Member variables (also known as data members)
The variables in your class.

Method definition
A definition that begins with the name of the class followed by two colons, the name of the function, and its parameters.

O

Object
An instance of a class.

Object oriented
A programming approach that takes the next step beyond procedural and structural programming. As the name implies, it takes advantage of the behavior of objects (defined in classes). In some cases, this term is overused for marketing purposes.

OO
See object oriented.

Operand
A mathematical term referring to the part of an expression operated upon by an operator.

Operator
A symbol that causes the compiler to take an action.

Overriding
When a derived class creates a member function that changes the implementation of a function in the base class. The overridden method must have the same return type and signature as the base method.

P

Pointer
A variable that holds a memory address.

Problem space
The set of problems and issues your program will try to solve.

Procedural programming
A series of actions performed on a set of data.

Polymorphism
The ability to treat many subtypes as if they were of the same base type.

Postfix operator
The postfix operator (zombies++) increments after evaluation.

Precedence value
The precedence value tells the compiler the order in which to evaluate operators.

Prefix operator
The prefix operator (––zombies) increments before evaluation.

Preprocessor
A program that runs before your compiler and handles lines that begin with a pound (#) symbol.

Prototype
Declaration of a function.

Private access
Access available only to the methods of the class itself or to methods of classes derived from the class.

Public access
Access available to methods of all classes.

Pure virtual function
A virtual function that must be overridden in the derived class because it has no code behind it. It is purely abstract with no implementation in the base class.

R

R-value
An r-value is an operand that can be on the right side of an operator.

RAM
Random access memory.

Reference
An alias to an object.

Relational operators
Determine whether two numbers are equal or if one is greater or less than the other.

S

Scope
Where a variable is visible and can be accessed.

Shallow copy
Copies the exact values of one object’s member variables to another object. Also called a member-wise copy.

Signature
The name of a function and its arguments.

Signed
A variable type that can hold negative and positive values.

Simulation
A computer model of part of a real-world system.

Singly linked list
A linked list in which nodes point to the next node in the list, but not back to the previous.

Solution space
The set of possible solutions to the problem.

Spaghetti code
Programs written in a tangled and difficult to read format with limited structure. It gets its name because it looks like a plate of spaghetti and is difficult to follow internal flow.

Stack
A special area of memory allocated for your program to hold the data required by each of the functions in your program. Another term for stack is LIFO (last in, first out) queue. The last (most recent) item placed in the LIFO is the first one pulled out.

Statement
A way to control the sequence of execution, evaluate an expression, or do nothing (the null statement).

Static member data
Unlike most member data elements within a class, this does not get replicated for each object created. Only one copy of these elements exists and can be accessed by all the objects of that class. It is typically used to keep track of the number of objects or anything else that applies to all member objects.

Static member functions
Like static member data, these exist in the scope of the class, not individual objects and can be invoked without referencing a specific object.

Stray pointer (also called dangling pointer)
The name for a pointer that is created when you perform delete on it and then try to access the memory that has been freed. This is a common bug that is difficult to debug because the fault (accessing the memory improperly) typically takes place long after the delete.

String
An array of characters ending with a null character.

Structured programming
A systematic approach to breaking programs down into procedures.

Symbolic constant
A typed and named value marked as constant, such as BoilingPoint.

Stubbing out
Writing only enough of a function to compile, leaving the details for later.

Subscript
Offsets into an array. The fourth element of myArray would be accessed as myArray[3].

T

Template
Provides the ability to create a general class or method and pass types as parameters.

Ternary operator
An operator that takes three terms. In C++, there is only one ternary operator, the ? operator, used as

a < b ? true : false;

which will return true if a is less than b, and otherwise will return false.

Token
A string of characters.

Tree
A complex data structure built from nodes, each of which points to two or more other nodes.

Type
The size and characteristics of an object.

Typedef
A data type definition. Acts as a synonym for a built-in data type.

U

UML
Unified Modeling Language. A standardized, graphical means of representing requirements and design.

Unary operator
An operator that takes only one term, such as a++, as opposed to a binary operator, which takes two terms, such as a+b.

Unsigned
A variable type that can hold only positive values.

Use case
A description of how the system will be used.

V

Variable
A named memory location in which you can store a value.

Virtual method
One of the means by which C++ implements polymorphism. This allows you to treat derived objects as if they were base objects.

v-table
The internal mechanism that keeps track of the virtual functions created within individual objects.

W

Waterfall
A method in which each stage is completed before the product is passed on to the next stage. Each stage is discrete and self-contained. This can be applied to software development or any project (including building a house or car or so forth).

Whitespace
Spaces, tabs, and new lines.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.255.178