P

Parent class; see inheritance.

A pointer is essentially the same as a memory address. The main difference is that a memory address is “untyped” (i.e., it can refer to any sort of variable) whereas a pointer always has an associated data type. For example, char* (pronounced “char star”) means “pointer to a char”. To say “a variable points to a memory location” is almost the same as saying “a variable's value is the address of a memory location”. In the specific case of a variable of type char*, to say “the char* x points to a C string” is essentially equivalent to saying “x contains the address of the first byte of the C string”. Also see array.

A polymorphic object is a C++ object that behaves polymorphically without exposing the user of the object to the hazards of pointers. The user does not have to know any of the details of the implementation, but merely instantiates an object of the single visible class (the manager class). That object does what the user wants with the help of an object of a worker class, which is derived from the manager class. Also see manager/worker idiom.

Polymorphism is the major organizing principle in C++ that allows us to implement several classes with the same interface and to treat objects of all these classes as though they were of the same class. Polymorphism is a variety of dynamic typing that maintains the safety factor of static type checking, because the compiler can determine at compile time whether a function call is legal even if it does not know the exact type of the object that will receive that function call at run time. “Polymorphism” is derived from the Greek poly, meaning “many”, and morph, meaning “form”. In other words, the same behavior is implemented in different forms.

To pop is to remove the top value from a stack.

The preprocessor is a part of the C++ compiler that deals with the source code of a program before the rest of the compiler ever sees that source code.

A preprocessor directive is a command telling the preprocessor to handle the following source xcode in a special manner.

A preprocessor symbol is a constant value similar to a const, but it is known only to the preprocessor, not to the rest of the compiler. The rules for naming preprocessor symbols are the same as those for other identifiers, but it is customary to use all upper-case letters in preprocessor symbols so that they can be readily distinguished from other identifiers.

The keyword private is an access specifier that denies nonmember functions access to member functions and member variables of its class.

Creating a class via private inheritance means that we are not going to allow outside functions to treat an object of the derived class as an object of the base class. That is, functions that take a base class object as a parameter will not accept a derived class object in its place. None of the public member functions and public data items (if there are any) in the base class will be accessible to the outside world via a privately derived class object. Contrast with public inheritance.

A program is a set of instructions specifying the solution to a set of problems, along with the data used by those instructions.

The program counter is a dedicated register that holds the address of the next instruction to be executed. During a function call, a call instruction pushes the contents of the program counter on the stack. This enables the called function to return to the calling function when finished.

Program failure can be defined as a situation in which a program does not behave as intended. The causes of this are legion, ranging from incorrect input data to improper specification of the problem to be solved.

Program maintenance is the process of updating and correcting a program once it has entered service.

Programming is the art and science of solving problems by the following procedure:

1.
Find or invent a general solution to a set of problems.

2.
Express this solution as an algorithm or set of algorithms.

3.
Translate the algorithm(s) into terms so simple that a stupid machine like a computer can follow them to calculate the specific answer for any specific problem in the set.

Warning: This definition may be somewhat misleading, since it implies that the development of a program is straightforward and linear, with no revision. This is known as the “waterfall model” of programming, since water going over a waterfall follows a preordained course in one direction. However, real-life programming doesn't usually work this way; rather, most programs are written in an incremental process as assumptions are changed and errors are found and corrected.

The keyword protected is an access specifier. When present in a base class definition, it allows derived class functions access to member variables and functions in the base class part of a derived class object, while preventing access by other functions outside the base class.

The keyword public is an access specifier that allows nonmember functions access to member functions and member variables of its class.

Creating a class via public inheritance means that we are going to let outside functions treat an object of the derived class as an object of the base class. That is, any function that takes a base class object as a parameter will accept a derived class object in its place. All of the public member functions and public data items (if there are any) in the base class are accessible to the outside world via a derived class object as well. Contrast with private inheritance.

Push means to add another value to a stack.

A put pointer holds the address of the next byte in the output area of an ostream — that is, where the next byte will be stored if we use << to write data into the stream.

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

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