# C/C++ Dictionary

address

A number which denotes the location of a piece of data within memory.

argument

Sometimes called the actual argument [Kernighan1988]. A value or variable provided to a function when it is called. A list of arguments appears between the parentheses in the function call. See also parameter.

array

A package of data, which goes by a single name, every value of which is of the same type Individual elements are accessed using an index which runs from 0 to size-1 of the array. All the data in an array is stored contiguously. An array does not know its own size, requiring programmers to keep track of it separately.

assignment

A statement of the form `variable = expression` whereby the expression on the right is first evaluated then the value that results is written into the variable on the left, overwriting its previous value.

bit

The smallest unit of information (and therefore of computer memory). A bit must take on one of the two values, one or zero.

block scope

A name declared at the internal level is said to have block scope. Specifically, its scope is from the point of declaration of the name to the end of nearest enclosing block within which the name was declared.

bool

A primitive type in C++. Variables of type `bool` may have only one of two values: true (1) or false (0). Usage note: when any integer type is converted to type bool, any non-zero value is converted to true.

boolean operator

An operator which compares two boolean operands and returns a boolean (`true` or `false`) result.

byte

An assemblage of 8 bits, usually the smallest practical unit of memory. Computer data is generally an integer (usually a power of 2) number of bytes.

call

(v) invoking a function (n) the invocation of a function. When a function is called the flow of control switches to the first line in the function and continues until a return is encountered. If the function returns a value, it evaluates to that value.

char

A primitive type in C++. One of the integer types. Variables of type `char` hold a binary code (typically either 1 byte ASCII or 2 byte Unicode) representing particular characters.

class

(n) a. A fundamental programming module in C++ which bundles data (called attributes) with functions (called methods). b. The means in C++ by which programmers control the specification and declaration of objects.

constant

1. A variable whose value doesn't change while a program is running. Also called a named constant or a symbolic constant.
2. A literal constant written directly into code.

condition

(n) A logical expression, that is one that evaluates ultimately to `true` or `false`.

constructor

(n) A special member function of a class which is called whenever an object of the class is created. Constructors never have a return type and always have the name of the class as their name.

cpu

(n) The Central Processing Unit of a computer, typically a single chip. The CPU carries out the basic fetch-execute-store cycle that is the heart of all computer operations: fetch an instruction from memory—fetch the data for the instruction from memory—execute the instruction on the data—store the result in memory.

data

(from the American Heritage Dictionary) Numerical or other information represented in a form suitable for processing by a computer.

destructor

(n) A special member function of a class which is called whenever an object of the class is destroyed (as,for example, when it goes out of scope). Destructors never have a return type or any arguments and always have the name of the class preceded by a ~ as their name. e.g. the destructor for class George is ~George().

double

A primitive type in C++. Variables of type double represent real numbers (called floating point numbers) and typically take more space and are slower to process than integer types.

downcast

1. A cast that can potentially lose precision as from `double` to `int`.
2. A cast where the result is potentially unrepresentable because the target set of values is smaller than the original set.
3. A cast from an object of a base class to an obect of a derived class.

expression

A combination of variables, constants, operators and functions which is progressively evaluated an operation at a time until it is reduced to a final value.

external level

Outside of any function.

file scope

See also scope, block scope. A name declared at the external level is said to have file scope. Specifically, its scope is from the point of declaration of the name to the end of the file.

function

The fundamental module of code. All code must appear inside some function, even if it's only `main`. Functions may return a value or `void`.

header file

A file typically containing type, class and/or standalone function declarations, as well as constants, with little or no active code, designed to be included in code files that are clients of the declared types, classes or functions.

ide

Integrated Development Environment: A suite of tools used for program development integrated into a single framework. Typically includes an editor (for preparing the source code), a compiler (for converting source files to object files), a linker for hooking multiple object files together into a program, a make utility, for deciding which files are out of date and need to be recompiled, and a debugger, for viewing the state of the machine as the code runs.

instruction

The smallest increment of computer code which can carry out a task. A function body normally contains one or more instructions. Instructions are usually issued to an underlying machine. Also called a statement.

int

A primitive type in C++. Variables of type int represent mathematical integers over a limited range that varies from computer to computer.

internal level

Inside the body of a function.

keyword

A word which is part of the built-in vocabulary of a computer language and thus may not be used by programmers to name variables, functions or objects.

library

A large body of standard code which may be included piecemeal into programs as needed.

literal

A constant which is typed directly into the code as `3`, `3.14159` or `"hello world"`.

expression

A combination of variables, constants and functions which can be progressively reduced to a single boolean value.

main

The top level file in a program. All programs must contain one and one only main function. Program execution always starts at the beginning of the main function.

memory

A part of the physical computer where both data and instructions are held, connected to the central processor by a data bus. Often referred to as RAM.

message

1. A function which is a member of a class. 2. Specifically, the invocation (calling) of a class member function.

method

1. A function which is a member of a class. 2. Specifically, the implementation of a class member function.

mnemonic

Self-descriptive. Generally applied to names that give a reader a good idea of what the named entity is or does.

name

An identifier used to designate entities such as variables, functions, classes or objects. Should follow the standard naming rules.

naming rules

Names consist of a sequence of letters, digits and underscore('_') characters with no spaces. May not start with an digit and may not be a keyword. Should not start with underscore as compilers do that. While any length is technically allowable, almost all compilers will distinguish names of up to 31 characters.

object

A particular instantiation of a class. An object has its own data (exactly like a structure variable) but shares the methods of the class.

operation

1. (fundamental) An action carried out by an operator, on one or more operands, that produces a result, normally a value. 2.(advanced) A function which is a member of a class. 3.(advanced) Specifically, the declaration of (and therefore the interface for) a class member function.

operator

A fundamental building block of expressions which signals that an operation is to be carried out on (usually) either one or two operands. Operands must be evaluated before the operation can be carried out. Operators usually return a single value known as the result of the operation.

parameter

Short for formal parameter. The name given to an argument in a function implementation. Parameters appear both in the function prototype and the function body and are effectively local variable declarations for the function. Parameters are used to receive data passed into the function when it is called

pass-by-refernce

An alternative calling mechanism available only in C++ whereby a refence to a calling argument is passed when a function is called. Effectively, the parameter in the function implementation is an alias for the calling argument (which must be a variable), allowing the calling argument to be changed from within the function.

pass-by-value

The default calling mechanism in C++ and C whereby only the value of an argument is passed when a function is called. Effectively, the parameter in the function implementation is a copy of the calling argument and can be changed with impunity without affecting the calling argument.

pointer

A variable whose value is the address of the desired value.

precedence

A set of rules to govern the order of operations based on the types of operators being used.

primitive type

A type predefined by the language, for example `int` or `bool`.

pseudo-code

A language independent form which uses the structure of computer code (e.g ifs and loops) but not the grammar. May include standard english and equations in place of code. Used for working out algorithms.

relational operator

An operator which compares two operands and returns a boolean (`true` or `false`) result.

scope

An attribute of a name. The range within a program over which a name is known.

statement

The smallest increment of computer code which can carry out a task. A function body normally contains one or more statements. Also called an instruction.

structure

A compound data type the individual components of which are accessed as named fields.

type

The category to which a piece of computer data is assigned. All data of a particular type will conform to a set of properties determined by that type, for example the amount of storage required to hold a piece of data or a range of acceptable values.

variable

Mathematics. a. A named quantity capable of assuming any of a set of values. b. A symbol representing such a quantity. Computing. a. A named location for holding a piece of computer data taken from a set of values. b. The name representing the location

value

The specific piece of computer data held in a variable.