Glossary of Terms

A C D E F I L N P R S V

Abstract Data Type

A data type which is defined by the programmer, rather than by the C++ language itself. ADTs include linked lists, doubly-linked lists, queues and trees.

Array

A series of variables tied together and listed under one name. The individual variables inside the array are referred to using numbers, starting at 0, so the first element of the array is referred to as number 0, the next as number 1, the next as number 2 etc. These are explained in their own special section.

Character

This is the name for a letter, a space or a punctuation symbol. Characters are usually referred to in C++ by putting them in single quotation marks, like this:

'F'
' '
'_'
'2'
','

This can be quite confusing, as strings (which are characters grouped together to form words or sentences) are usually enclosed within double quotation marks. You can see that there are characters that look like digits as well. Characters can also be control codes such as Carriage Return.

Comment

Text in a program that is ignored by the compiler. It forms no part of a compiled program and is only included for the benefit of human readers. Comments are useful so that the readers can find their way around the program.

Compiler

A program that takes a file of C++ source code (written in a plain text file) and turns it into the sort of low-level code that the computer will run.

Compile Time Error

Any error that is detected at the point when the compiler translates the program into computer code. These are grammatical errors, also called Syntax Errors. classes, and which is executed whenever a variable of that class is declared. Click here for more details. See also destructors.

Data Type

C++ insists when you set up a variable, that you define what sort of variable it is going to be. It may be an integer, which means that it can only store whole numbers, or it could be a floating point number, which can hold decimals. There are other data types as well.

Decrementing

The process of decreasing the value of a variable. This is usually done using either -- (if you want to decrease the value by 1) or -= (if you want to decrease it by some other value). See also Incrementing, and Chapters 8 and 10.

Destructor

This is a special function which can be included in classes, and which is executed whenever a variable of that class is destroyed (i.e. goes out of scope, or the program ends). Click here for more details. See also constructors.

Expression

A set of items in a program that produce either a number or a string. An expression that produces a number is called a numeric expression, such as 2 + 3 which produces the number 5 or 55 / 10 + 4.1 which produces 9.6. An expression that produces a string is called a string expression, such as "Microwave " << "Oven" which produces the string Microwave Oven.

An expression is not a complete program statement on its own. It can only be used as part of a statement, for instance, in a variable assignment.

Floating point number

A decimal number. You set up an floating point number using float

Function

A set of computer instructions that are joined together to perform a given (possibly complicated) task.

Incrementing

The process of increasing the value of a variable. This is usually done using either ++ (if you want to increase the value by 1) or += (if you want to increase it by some other value). See also Decrementing and chapters 8 and 10.

Integer

A whole number. You set up an integer using int, long, unsigned int or unsigned long.

Linked List

This is an Abstract Data Type, consisting of structures "tied together" with pointers. It takes the form of a list of items, similar to a queue, with the pointers allowing the program to move from one item to the next. Linked lists are explained in detail in a special section

Loop

Any sequence of instructions that repeats more than once, usually several times. There are three basic types of loop, for, while and do while.

Nested Loop

Any loop which is completely enclosed within another loop.

Parameter

A parameter is a the name of a value that has been passed to a function. The parameter has a name within the function and that is how it is referred to within the function, even though it may have a totally different name in the outside program.

Pointer

A pointer is a variable that doesn't hold a data value as such (the way an integer or floating point variable does), but holds the address of another variable, i.e. it holds a number, and that number tells the program where to find the "proper" variable value (the item that the pointer is "pointing to").

Run Time Error

Any error which only comes to light when the program is run. These are errors which the compiler can't detect, for instance, when the user types in 0 for a number and then the compiler divides another number by it.

Statement

A self-contained program instruction. The instruction carries out a particular action inside the computer program. Statements in C++ always end with semicolons.

Stream

This is a channel for getting data into and out of a C++ program. The normal stream to use is the input/output stream which is "hooked" into a program using the #include <iostream.h> command. The other main stream is the file stream, used for getting data in and out of disc files.

String

A group of letters, spaces and punctuation (collectively known as characters) put together end to end. A string is basically English text, with double quotation marks round it. Here are some examples of strings:

"To be or not to be, that is the question."
"Testing, testing, 1, 2, 3."
"#£$%&^!!!! Listen who swears! Christopher Robin has fallen downstairs!"

Variable

A variable is the way that any programming language stores numbers and other general data. They are like the letters used in algebra to stand for numbers:

x = 2.33;
cache = 12000;
my_try_1 = -255;

Go back Go back Top of the page Top of the page