Special Characters

& has a number of distinct meanings. When it precedes the name of a variable without following a type name, it means "the address of the following variable". For example, &Str means "the address of the variable Str". When & follows a type name and precedes a variable name, it means that the variable which is being declared is a reference; that is, another name for a pre-existing variable. In this book, references are used only in argument lists, where they indicate that the variable being defined is a new name for the caller's variable rather than a new local variable.

< is the "less than" operator, which returns the value true if the expression on its left has a lower value than the expression on its right; otherwise, it returns the value false.

= is the assignment operator, which assigns the value on its right to the variable on its left.

> is the "greater than" operator, which returns the value true if the expression on its left has a greater value than the expression on its right; otherwise, it returns the value false.

[ is the left square bracket; see square brackets for usage.

] is the right square bracket; see square brackets for usage.

{ is the left curly brace; see curly braces for usage.

} is the right curly brace; see curly braces for usage.

!= is the "not equals" operator, which returns the value true if the expression on its left has a value different from the expression on its right; otherwise, it returns the value false.

&& is the "logical AND" operator. It produces the result true if both of the expressions on its right and left are true; if either of those expressions is false, it produces the result false.

++ is the increment operator, which adds 1 to the variable to which it is affixed.

+= is the add to variable operator, which adds the value on its right to the variable on its left.

-= is the subtract from variable operator, which subtracts the value on its right from the variable on its left.

// is the comment operator; see comment for usage.

<< is the "stream output" operator, used to write data to an ostream.

<= is the "less than or equal to" operator, which returns the value true if the expression on its left has the same value or a lower value than the expression on its right; otherwise, it returns the value false.

== is the "equals" operator, which returns the value true if the expression on its left has the same value as the expression on its right; otherwise, it returns the value false.

> is the "greater than or equal to" operator, which returns the value true if the expression on its left has the same value or a greater value than the expression on its right; otherwise, it returns the value false.

>> is the "stream input" operator, used to read data from an istream.

[] is used after the delete operator to tell the compiler that the pointer for which delete was called refers to a group of elements rather than just one data item. This is one of the few times when we have to make that distinction explicitly, rather than leaving it to context.

|| is the "logical OR" operator. It produces the result true if at least one of the two expressions on its right and left is true; if both of those expressions are false, it produces the result false.

A #include statement has the same effect as copying all of the code from a specified file into a source code file at the point where the include statement is written. For example, if we wanted to use definitions contained in a file called iostream.h in the source code file test.cc, we could insert the include statement #include <iostream.h> in test.cc rather than physically copying the lines from the file iostream.h into test.h.


To return to the main glossary page, click here