CPPGlossary

ref

bit  the basic unit of information in a computer. A bit can have the value 0 or the value 1.
byte the basic unit of addressing in most computers. Typically, a byte holds 8 bits.
word a basic unit of memory in computer, usually the unit used to hold an integer or a pointer. On many machines, an object must be aligned on a word boundary for acceptable performance. 
function a named unit of code that can be invoked (called) from different parts of a program; a logical unit of computation.
value a set of bits in memory interpreted according to a type.
declaration the specification of a name with its type in a program.
definition a declaration of an entity that supplies all information necessary to complete a program using the entity. Simplified definition: a declaration that allocates memory.
type something that defines a set of possible values and a set of operations for an object.
name equence of letters and digits started by a letter, used to identify ("name") user-defined entities in program text. An underscore is considered a letter. Names are case sensitive. The standard imposes no upper limit on the length of names.
object (1) an initialized region of memory of a known type which holds a value of that type; (2) a region of memory.
operation something that can perform some action, such as a function and an operator.
parameter a declaration of an explicit input to a function or a template. When called, a function can access the arguments passed through the names of its parameters.
argument a value passed to a function or a template, in which it is accessed
through a parameter.
expression combination of operators and names producing a value .
const a attribute of a declarations that makes the entity to which it refers readonly.
header a file containing declarations used to share interfaces between
parts of a program.
interface a declaration or a set of declarations specifying how a piece of code (such as a function or a class) can be called.

abstract class a class that cannot be directly used to create objects; often used to define an interface to derived classes. A class is made abstract by having a pure virtual function or a protected constructor.

abstraction a description of something that selectively and deliberately ignores (hides) details (e.g., implementation details); selective ignorance.

address a value that allows us to find an object in a computer’s memory.

algorithm a procedure or formula for solving a problem; a finite series of computational steps to produce a result.

alias an alternative way of referring to an object; often a name, pointer, or reference.

application a program or a collection of programs that is considered an entity by its users.

approximation something (e.g., a value or a design) that is close to the perfect or ideal (value or design). Often an approximation is a result of trade-offs among ideals.

argument a value passed to a function or a template, in which it is accessed through a parameter.

array a homogeneous sequence of elements, usually numbered, e.g., [0:max).

assertion a statement inserted into a program to state (assert) that something must always be true at this point in the program.

base class a class used as the base of a class hierarchy. Typically a base class has one or more virtual functions.

bit a unit of memory that can hold 0 or 1. An individual bit cannot be directly accessed in C++ (the unit of addressing is a byte), but a bit can be accessed through a bitfield or by using the bitwise logical operators & and |.

bug an error in a program.

built-in type - A type provided directly by C++, such as int, double, and char*. See also: integral types, floating-point type, pointer, reference.

byte the basic unit of addressing in most computers. Typically, a byte holds 8 bits that can hold a character of the C++ representation character set. .

C-style cast dangerous form of explicit type conversion; prefer new-style cast if you must use explicit type conversion.

C-style string zero-terminated array of characters, supported by C standard library functions. A low-level and error-prone mechanism; where possible prefer strings.

call-by-reference declaring a function argument type to be a reference, thus passing a reference rather than a value to the called function.

call-by-value passing a copy of an argument to the called function. The semantics of function call is to pass a copy of an argument. The copy operation is defined by the argument type's copy constructor.

cerr standard unbuffered ostream for error or diagnostic output.

character set a set of integer values with a mapping to character representations; for example, ASCII (ANSI13.4-1968) gives meaning to the values 0-127. ASCII is C++'s representation character set, the character set used to represent program source text.

class a user-defined type. A class can have member functions, member data, member constants, and member types. A class is thee primary mechanism for representing concepts in C++.

code a program or a part of a program; ambiguously used for both source code and object code.

compiler a program that turns source code into object code.

complexity a hard-to-precisely-define notion or measure of the difficulty of constructing a solution to a problem or of the solution itself. Sometimes complexity is used to (simply) mean an estimate of the number of operations needed to execute an algorithm.

const attribute of a declaration that makes the entity to which it refers readonly.

computation the execution of some code, usually taking some input and producing some output.

concept (1) a notion, an idea; (2) a set of requirements, usually for a template argument.

concrete class a class for which objects can be created.

constant a value that cannot be changed (in a given scope); not mutable.

constructor an operation that initializes (“constructs”) an object. Typically a constructor establishes an invariant and often acquires resources needed for an object to be used (which are then typically released by a destructor).

container an object that holds elements (other objects).

copy an operation that makes two objects have values that compare equal. See also move.

correctness a program or a piece of a program is correct if it meets its specification. Unfortunately, a specification can be incomplete or inconsistent, or can fail to meet users’ reasonable expectations. Thus, to produce acceptable code, we sometimes have to do more than just follow the formal specification.

cost the expense (e.g., in programmer time, run time, or space) of producing a program or of executing it. Ideally, cost should be a function of complexity.

data values used in a computation.

debugging the act of searching for and removing errors from a program; usually far less systematic than testing.

declaration the specification of a name with its type in a program.

definition a declaration of an entity that supplies all information necessary to complete a program using the entity. Simplified definition: a declaration that allocates memory.

derived class a class derived from one or more base classes.

design an overall description of how a piece of software should operate to meet its specification.

destructor an operation that is implicitly invoked (called) when an object is destroyed (e.g., at the end of a scope). Often, it releases resources.

encapsulation protecting something meant to be private (e.g., implementation details) from unauthorized access.

error a mismatch between reasonable expectations of program behavior (often expressed as a requirement or a users’ guide) and what a program actually does.

escape character the character \, also called backslash, set an initial character in representations of characters that cannot be represented by a single ASCII character, such as newline ('\n') and horizontal tab ('\t').

executable a program ready to be run (executed) on a computer.

expression combination of operators and names producing a value.

extern a keyword used to indicate that the definition of an entity being declared is defined elsewhere. Because "extern: is only necessary for global variables it is largely redundant.

false bool value; converts to 0.

feature creep a tendency to add excess functionality to a program “just in case.”

file a container of permanent information in a computer.

floating-point number a computer’s approximation of a real number, such as 7.93 and 10.78e–3.

function a named unit of code that can be invoked (called) from different parts of a program; a logical unit of computation.

function object object with the application operator, operator()(), defined so that it can be called like a function. A function object is more general than a function because it can hold data and provide additional operations. Sometimes called a functor. Given current compiler technology, simple function objects inline better than pointers to functions, so that parameterization with function objects can be far more efficient than use of pointers to functions or virtual functions.

garbage collection techniques for reclaiming unused memory without relying on user-supplied delete or free() commands. A permitted but not required technique for C++. Commercial and free garbage collectors exist for C++. Use of classes that control their own storage, such as the standard library vector, string, and map, reduces the need for garbage collection. See also: resource acquisition is initialization, destructor.

general-purpose programming language (1) a programming language intended for use in a wide range of application areas without restrictions that make it totally unsuitable for traditional major uses of computers, such as mathematical computations, data processing, text processing, graphics, and communications. (2) a language that can do what at least as much as other languages called "general purpose" can do. See also: C++.

generic programming programming using templates to express algorithms and data structures parameterized by data types, operations, and polices. a style of programming focused on the design and efficient implementation of algorithms. A generic algorithm will work for all argument types that meet its requirements. In C++, generic programming typically uses templates.

global scope the scope containing all names defined outside any function, class, or namespace. Names in the global scope can be prefixed by ::. For example, ::main().

GUI Graphical User Interface. There are many C++ libraries and tools for building GUI-based applications, but no standard C++ GUI.

handle an object that controls access to another. Often, a handle also controls the acquisition and release of resources. A common use is for a handle to control access to a variably-sized data structure. a class that allows access to another through a member pointer or reference. See also copy, move, resource.

header a file containing declarations used to share interfaces between parts of a program. file holding declarations used in more than one translation unit. Thus, a header file acts as an interface between separately compiled parts of a program. A header file often contains inline function definitions, const definitions, enumerations, and template definitions, but it cannot be #included from for than one source file if it contain non-inline function definitions or variable definitions.

hiding the act of preventing a piece of information from being directly seen or accessed. For example, a name from a nested (inner) scope can prevent that same name from an outer (enclosing) scope from being directly used.

ideal the perfect version of something we are striving for. Usually we have to make trade-offs and settle for an approximation.

if-statement statement selecting between two alternatives based on a condition.

implementation (1) the act of writing and testing code; (2) the code that implements a program.

implementation defined an aspect of C++'s semantics that is defined for each implementation rather than specified in the standard for every implementation. An example is the size of an int (which must be at least 16 bits but can be longer). Avoid implementation defined behavior whenever possible.

infinite loop a loop where the termination condition never becomes true. See iteration.

infinite recursion a recursion that doesn’t end until the machine runs out of memory to hold the calls. In reality, such recursion is never infinite but is terminated by some hardware error.

information hiding the act of separating interface and implementation, thus hiding implementation details not meant for the user’s attention and providing an abstraction.

initialize giving an object its first (initial) value.

input values used by a computation (e.g., function arguments and characters typed on a keyboard).

integer a whole number, such as 42 and –99.

integer type a short, int, or long. Standard C++ doesn't support long long.

integral type a bool, character type, or integer type. Supports arithmetic and logical operations.

interface a declaration or a set of declarations specifying how a piece of code (such as a function or a class) can be called.

invariant something that must be always true at a given point (or points) of a program; typically used to describe the state (set of values) of an object or the state of a loop before entry into the repeated statement.

iteration the act of repeatedly executing a piece of code; see recursion.

iterator an object that identifies an element of a sequence.

library a collection of types, functions, classes, etc. implementing a set of facilities (abstractions) meant to be potentially used as part of more than one program.

lifetime the time from the initialization of an object until it becomes unusable (goes out of scope, is deleted, or the program terminates).

linker a program that combines object code files and libraries into an executable program. the part of a C++ implementation that merge the code generated from separately compiled translation units into a program or part of a program.

literal a notation that directly specifies a value, such as 12 specifying the integer value “twelve.”

loop a piece of code executed repeatedly; in C++, typically a for-statement or a while-statement.

macro facility for character substitution; doesn't obey C++ scope or type rules. C++ provides alternatives to most uses of macros; see template, inline, const, and namespace. Don't use macros unless you absolutely have to.

main() the function called by the system to start a C++ program.

move an operation that transfers a value from one object to another, leaving behind a value representing “empty.” See also copy.

maintenance work on a program after its initial release. Typical maintenance activities include bug fixing, minor feature enhancements, porting to new systems, improvements of error handling, modification to use different natural languages, improvements to documentation, and performance tuning. Maintenance typically consumes more than 80% of the total effort and cost expended on a program.

memory management a way of allocating and freeing memory. In C++ memory is either static, allocated on the stack, or allocated on the free store. When people talk about memory management, they usually think of free store or even specifically about garbage collection. Memory can often be effectively managed through standard library containers, such as vector or string, or through general resource management techniques. See also: auto_ptr, constructor, destructor, resource acquisition is initialization.

mutable changeable; the opposite of immutable, constant, and variable. an attribute of a member that makes it possible to change its value even if its object is declared to be const

name equence of letters and digits started by a letter, used to identify ("name") user-defined entities in program text. An underscore is considered a letter. Names are case sensitive. The standard imposes no upper limit on the length of names.

object (1) an initialized region of memory of a known type which holds a value of that type; (2) a region of memory.

object code output from a compiler intended as input for a linker (for the linker to produce executable code).

object file a file containing object code.

object-oriented programming a style of programming focused on the design and use of classes and class hierarchies.

one definition rule there must be exactly one definition of each entity in a program. If more than one definition appears, say because of replication through header files, the meaning of all such duplicates must be identical.

operation something that can perform some action, such as a function and an operator.

operator conventional notation for built-in operation, such as +, *, and &. A programmer can define meanings for operators for user-defined types.

output values produced by a computation (e.g., a function result or lines of characters written on a screen).

optimizer a part of a compiler that eliminates redundant operations from code and adjusts code to perform better on a given computer.

overflow producing a value that cannot be stored in its intended target.

overload defining two functions or operators with the same name but different argument (operand) types.

override defining a function in a derived class with the same name and argument types as a virtual function in the base class, thus making the function callable through the interface defined by the base class.

owner an object responsible for releasing a resource.

paradigm a somewhat pretentious term for design or programming style; often used with the (erroneous) implication that there exists a paradigm that is superior to all others.

parameter a declaration of an explicit input to a function or a template. When called, a function can access the arguments passed through the names of its parameters.

pointer (1) a value used to identify a typed object in memory; (2) a variable holding such a value. pointer - an object holding an address or 0.

preprocessor the part of a C++ implementation that removes comments, performs macro substitution and #includes. Avoid using the preprocessor whenever possible.

priority_queue standard library queue where a priority determines the order in which an element reaches the head of the queue.

procedural programming programming using procedures (functions) and data structures (structs).

post-condition a condition that must hold upon exit from a piece of code, such as a function or a loop.

pre-condition a condition that must hold upon entry into a piece of code, such as a function or a loop.

program code (possibly with associated data) that is sufficiently complete to be executed by a computer.

programming the art of expressing solutions to problems as code.

programming language a language for expressing programs.

pseudo code a description of a computation written in an informal notation rather than a programming language.

pure virtual function a virtual function that must be overridden in a derived class.

RAII (“Resource Acquisition Is Initialization”) a basic technique for resource management based on scopes.

range a sequence of values that can be described by a start point and an end point. For example, [0:5) means the values 0, 1, 2, 3, and 4.

recursion the act of a function calling itself; see also iteration.

reference (1) a value describing the location of a typed value in memory; (2) a variable holding such a value.

reinterpret_cast a type conversion operation that reinterprets the raw memory of an object as a value of another type. The result of a reinterpret_cast can only be portably used after being converted back into its original type. Use only as a last resort.

regular expression a notation for patterns in character strings.

requirement (1) a description of the desired behavior of a program or part of a program; (2) a description of the assumptions a function or template makes of its arguments.

resource something that is acquired and must later be released, such as a file handle, thread, a lock, or memory. See a lso handle, owner.

rounding conversion of a value to the mathematically nearest value of a less precise type.

scope the region of program text (source code) in which a name can be referred to.

separate compilation the practice of compiling parts of a program, called translation units, separately and then later linking the results together using a linker. This is essential for larger programs.

sequence elements that can be visited in a linear order.

smart pointer user-defined type providing operators like a function, such as * and ++, and with a semantics similar to pointers. See also: iterator. Sometimes smart a pointer is called a handle.

software a collection of pieces of code and associated data; often used interchangeably with program.

source code code as produced by a programmer and (in principle) readable by other programmers.

source file a file containing source code.

specification a description of what a piece of code should do.

stack (1) memory used to hold local variables for a function. (2) standard library first-in-last-out sequence.

standard an officially agreed-upon definition of something, such as a programming language.

state a set of values.

statement the basic unit controlling the execution flow in a function, such as if-statement, while-statement, do-statement, switch-statement, expression statement, and declaration.

static (1) keyword used to declare a class member static; meaning allocated in static memory. For a member function, this implies that there is no this pointer. (2) keyword used to specify that a local variable should be allocated in static memory. (3) deprecated: keyword used to specify that a global name should not be visible from other translation units.

static memory memory allocated by the linker.

static_cast a type conversion operation that converts between related types, such as pointer types within a class hierarchy and between enumerations and integral types.

string a sequence of characters.

struct class with members public by default. Most often used for data structures without member functions or class invariants, as in C-style programming.

style a set of techniques for programming leading to a consistent use of language features; sometimes used in a very restricted sense to refer just to low-level rules for naming and appearance of code.

subtype derived type; a type that has all the properties of a type and possibly more.

supertype base type; a type that has a subset of the properties of a type.

switch-statement statement selecting among many alternatives based on an integer value.

system (1) a program or a set of programs for performing a task on a computer; (2) a shorthand for “operating system,” that is, the fundamental execution environment and tools for a computer.

template a class or a function parameterized by one or more types or (compile-time) values; the basic C++ language construct supporting generic programming.

testing a systematic search for errors in a program.

trade-off the result of balancing several design and implementation criteria.

truncation loss of information in a conversion from a type into another that cannot exactly represent the value to be converted.

type something that defines a set of possible values and a set of operations for an object.

type checking the process of checking that every expression is used according to its type. the compiler checks every expression based on the declared types of the names involved.

type conversion producing a value of one type from a value of another type. A type conversion can be an implicit conversion or an explicit conversion. See also: user-defined type conversion, cast.

type safety the property that an object can be accessed only according to its definition. C++ approximates this ideal. A programmer can violate type safety by explicitly using a cast, by using an uninitialized variable, by using a pointer that doesn't point to an object, by accessing beyond the end of an array, and by misusing a union. For low-level systems code, it can be necessary to violate type safety (e.g. to write out the byte representation of some objects), but generally type safety must be preserved for a program to be correct and maintainable.

uninitialized the (undefined) state of an object before it is initialized.

unit (1) a standard measure that gives meaning to a value (e.g., km for a distance); (2) a distinguished (e.g., named) part of a larger whole.

use case a specific (typically simple) use of a program meant to test its functionality and demonstrate its purpose.

value a set of bits in memory interpreted according to a type.

variable a named object of a given type; contains a value unless uninitialized. named object in a scope.

variable definition declaration of a named object of a data type without an extern specifier.

virtual function a member function that can be overridden in a derived class.

void* pointer to void; that is, a pointer to an object of unknown type; also called pointer to raw memory. A void* cannot be used or assigned without a cast.

volatile attribute of a declaration telling the compiler that an entity can have its value changed by extralinguistic means;

wchar_t wide character type. Used to hold characters of character sets that require more than a byte to represent, such as unicode.

whitespace characters that a represented only by the space they take up on a page or screen. The most common examples are space (' '), newline ('\n'), and tab ('\t').

word a basic unit of memory in computer, usually the unit used to hold an integer. On many machines, an object must be aligned on a word boundary for acceptable performance.