Skip to main content

Glossary



A

Algorithm - Used specifically in C++ to refer to a function from the standard algorithm library that can manipulate a container. Algorithms exist for sorting, searching a container, transforming all the values in a container, etc.

Array - A low-level form of storage that C++ inherits from its parent language, C. Arrays are a contiguous sequence of memory locations, capable of storing values of a particular type. Unlike vectors, array size is fixed and, what is more, must be known at compile time.

Assembly - One stage of 'compilation', in which human readable assembly language representation of source files are turned into binary files of object code.


C

Cast - The mechanism that C++ provides for explicit type conversion. A cast operates on a value of one type and yields a result of another user specified type. A typical example would be conversion of a double value into an int value.

Class - The fundamental unit of object oriented programming, specifying the variables that characterise a particular type of object and defining the operations supported by that type of object.

Command Line Arguments (CLA) - An element of the command line that was typed in order to run a program. The 'command line arguments' are the items appearing after the program name. They are separated from one another by spaces.

Comment - Explanatory text in the source code that is provided for the human reader of the code and ignored by the compiler.

Compilation - A casual term for the process of generating an executable from C++ source code. More accurately, this term describes one stage of that process, in which pre-processed C++ source code is translated into an assembly language representation.

Compiler - The software tool that carries out the compilation process.

Constructor - A special method in a class definition with the specific role of initialising an instance of that class.


D

Dependency - A file upon which another file depends. In a rule of a makefile, a target will be regenerated from a dependency if that dependency has a modification time more recent that that of the target.

Dereferencing - A term applied to the use of a pointer or iterators. Dereferencing a pointer gives us the value at the memory address to which the pointer is currently pointing. Dereferencing an iterator gives us the value in a container to which the iterator is currently pointing.


E

Escape Sequence A sequence of characters that represent some other character - typically one that is difficult to represent directly. For example, '\n' represents the newline character, '\t' represents the tab character, etc.

Exception - A signal that an exceptional condition has occurred - typically a run time error of some kind. Once raised, exceptions will halt a program unless they are intercepted.

Executable - The finished executable form of a C++ program; a file of machine code instructions that can be run on the computer's CPU by the operating system.


F

Field Width - In output formatting operations, the minimum number of characters used to format a value - set using the setw stream manipulator.


H

Header (File) - A file of definitions needed for some purpose, imported into a program using the #include directive. For example, C++ programs wishing to do input from the keyboard and output to the terminal will need to include the iostream header.


I

Implicit Type Conversion - A process applied to expressions containing mixed types, to ensure that all values have the same type prior to evaluation of the expression. For example, if an expression mixes int values with double values, the int value will be implicitly promoted to double values before evaluation.

Initialiser List - A compact syntax used to copy constructor parameter values into associated instance variables in class definition.

Inlining - The process of including the bodies of methods in a class definition, rather than having them appear in a separately compiled implementation file. If an inlined method body is sufficiently small, the compiler will simply insert that code at any point where an attempt to call the method is made, rather than inserting code to actually call the method.

Instance Variable One of the variables that collectively characterise the state of an object. Typically declared as private inside a class definition, preventing the external software environment from tampering with them, whether deliberately or accidentally.

Iterator - A consistent and implementation independent mechanism that the C++ standard library provides for moving through the items stored in a container.


L

Library - See also 'Static Library'.

Linking - The final step in compilation, in which object code files are combined with code from libraries to create a self contained executable.

List - Standard C++ data structure that stores a sequence of values as nodes linked by pointers. Like vectors, lists can grow or shrink on demand, but their very different implementation gives them very different performance characteristics.

Loop Control Variable - The variable used to control iteration of a while of for loop. Testing of this variable determines whether the loop continues to run or not.


M

Makefile - A specification of the files used by a multi-file program, their dependencies and the commands needed to compile them.

Manipulator - See also 'Stream Manipulator'.

Map - Standard C++ data structure mapping keys of one type onto values of another type.

Method - A function associated with a class. Unlike functions, methods cannot be invoked without an instance of the class being present. Collectively, the methods of a class describe the ways in which instances of that class can behave.


N

Namespace - A means of isolating definitions and protecting them from potential name clashes with other elements of your program. Features of the C++ standard library are defined inside the std namespace.


O

Object Code - Machine code instructions generated by the compiler, prior to the linking phase that generates a finished executable.


P

Pointer - A variable that holds the memory address for a value of a given type, or the memory address of the first value in a sequence of values of a given type.

Pre-Processing - Initial stage of compilation, in which #include and other directives are dealt with by the compiler.


R

Reference - an alias for a variable.

Rule - Key element of a makefile, consisting of a target, its dependencies and the commands needed to regenerate the target from its dependencies should it be out-of-date relative to them.


S

Shared Object - The dynamically linked version of a static library. Code will not be physically merged with a program during linking but will instead be loaded into memory and referenced at run time.

Static Library - An archive of object code, against which programs will be linked. The linking process extracts the required object code from the archive and merges it with the program's object code to form the final executable.

Stream - The metaphor that C++ uses for input and output. An input stream can be thought of as a potentially infinite sequence of characters or bytes from which we can extract data. An output stream is a sequence of characters or bytes with an eventual destination (e.g. a file or the terminal window) into which we can insert data.

Stream Extraction Operator - The >> operator, used to extract characters from an input stream and convert them into a representation appropriate for storage in a variable.

Stream Insertion Operator - The << operator, user to convert a value into characters that are then inserted into an output stream.

Stream Manipulator - An object inserted into an input stream or output stream (more usually the latter) in order to modify subsequent input or output operations. For example, the endl manipulator inserts a newline character and flushes the buffer used by an output stream, ensuring that output reaches its destination, whereas the setw manipulator is typically used to specify the field width for the next insertion of a value into an output stream.


T

Target - The goal of a rule in a makefile - typically a file that is supposed to be generated by executing the commands in the rule.


V

Vector - Standard C++ data structure capable of storing multiple values of a given type as a contiguous sequence of memory locations. unlike an array, a vector can grow or shrink in size over its lifetime.


W

Whitespace - Collective term for spaces, tabs and newline characters - i.e., any character that appears as some form of blank space in text.