S

A scalar variable has a single value (at any one time); this is contrasted with a vector or an array, which contains a number of values, each of which is referred to by its index.

The scope of a variable is the part of the program in which the variable can be accessed. The scopes with which we are concerned are local, global, and class; see local scope, global scope, and class scope for more details.

A selection expression is the part of a switch statement that specifies an expression used to select an alternative section of code.

A selection sort is a sorting algorithm that selects the highest (or lowest) element from a set of elements (the “input list”) and moves that selected element to another set of elements (the “output list”); the next highest (or lowest) element is then treated in the same manner. This operation is repeated until as many elements as desired have been moved to the output list.

A short is a type of integer variable that can represent a whole number. With most current C++ compilers, including the one on the CD in the back of the book, a short occupies 2 bytes of storage and therefore can represent a number in either the range -32768 to 32767 (if signed) or the range 0 to 65535 (if unsigned).

The short-circuit evaluation rule governs the execution of the || and && operators. See || and && for details.

A side effect is any result of calling a function that persists beyond the execution of that function other than its returning a return value. For example, writing data to a file is a side effect.

The signature of a function consists of its name and the types of its arguments. In the case of a member function, the class to which the function belongs is also part of its signature. Every function is uniquely identified by its signature, which is what makes it possible to have more than one function with the same name. This is called function overloading.

A signed char is a type of integer variable. See char for details.

A signed int is a type of integer variable. See int for details.

A signed long is a type of integer variable. See long for details.

A signed short is a type of integer variable. See short for details.

A signed variable can represent either negative or positive values. See char, short, int, or long for details.

Slicing is the partial assignment that occurs when a derived class object is assigned to a base class variable. This term is used because in such an assignment only the base class part of the derived class object is assigned while the other fields are “sliced off”.

Software refers to the nonphysical components of a computer, the ones you cannot touch. If you can install it on your hard disk, it's software. Examples include a spreadsheet, a word processor, and a database program.

Source code is a program in a form suitable for reading and writing by a human being.

Source code file; see implementation file.

Source code module; see implementation file.

The space character is one of the nonprinting characters (or nondisplay characters) that control the format of displayed or printed information.

Special constructor; a constructor used in the implementation of a polymorphic object to prevent an infinite recursion during construction of that object.

The square brackets, [ and ], are used to enclose an array or vector index, which selects an individual element of the array or vector. Also see [ ].

A stack is a data structure with characteristics similar to those of a spring-loaded plate holder such as you might see in a cafeteria. The last plate deposited on the stack of plates will be the first one removed when a customer needs a fresh plate; similarly, the last value deposited (pushed) onto a stack is the first value retrieved (popped).

The stack pointer is a dedicated register. It is used to keep track of the address of the most recently pushed value on the stack.

Standard library: See C++ standard library, C standard library.

A starting expression is the part of a for statement that is executed once before the controlled block of the for statement is first executed. It is often used to initialize an index variable to 0 so that the index variable can be used to refer to the first element of an array or vector. See for statement for an example.

A statement is a complete operation understood by the C++ compiler. Each statement ends with a semicolon (;).

A static member function is a member function of a class that can be called without reference to an object of that class. Such a function has no this pointer passed to it on entry and therefore cannot refer to normal (non-static) member variables of the class.

A static member variable is a member variable of a class that is shared among all objects of that class. This is distinct from the treatment of the normal (non-static) member variables of the class. Each object of a class has its own set of normal member variables.

The static storage class is the simplest of the three storage classes in C++; variables of this storage class are assigned memory addresses in the executable program when the program is linked. This use of the term “static” is distinct from but related to the keyword static.

Static type checking refers to the practice of checking the correct usage of variables of different types during compilation of a program rather than during execution. C++ uses static type checking. See type system for further discussion. Note that this has no particular relation to the keyword static.

Static typing means determining the exact type of a variable when the program is compiled. It is the default typing mechanism in C++. Note that this has no particular relation to the keyword static, nor is it exactly the same as static type checking. See type system for further discussion.

std:: is the name of the standard C++ library namespace. This namespace contains the names of all of the functions and variables declared in the standard library.

Stepwise refinement is the process of developing an algorithm by starting out with a “coarse” solution and “refining” it until the steps are within the capability of the programming language you are using to write a program.

Storage; synonym for memory.

A storage class is the characteristic of a variable that determines how and when a memory address is assigned to that variable. C++ has three storage classes: static, auto, and dynamic. Please note that the term storage class has nothing to do with the C++ term class. See static storage class, auto storage class, and dynamic storage class for more details.

A storage function is a function that stores data for later retrieval by a retrieval function.

A stream is a place to put (in the case of an ostream) or get (in the case of an istream) characters. Two predefined streams are cin and cout.

A stream buffer is the area of memory where the characters put into a stream are stored.

The string class defines a type of object that contains a group of chars; the chars in a string can be treated as one unit for purposes of assignment, I/O, and comparison.

A stringstream is a type of stream that exists only in memory rather than being attached to an input or output device. It is often used for formatting of data that is to be further manipulated within the program.

The switch statement is effectively equivalent to a number of if/else statements in a row, but is easier to read and modify. The keyword switch is followed by a selection expression (in parentheses), which specifies an expression that is used to select an alternative section of code. The various alternatives to be considered are enclosed in a set of curly braces following the selection expression. Each alternative is marked off by the keyword case followed by the (constant) value to be matched and a colon.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset