F

The keyword false is a predefined value representing the result of a conditional expression whose condition is not satisfied. For example, in the conditional expression x < y, if x is not less than y, the result of the expression will be false. Also see bool.

A fencepost error is a logical error that causes a loop to be executed one more or one fewer time than the correct count. A common cause of this error is confusing the number of elements in a vector or array with the index of the last element. The derivation of this term is by analogy with the problem of calculating the number of fence sections and fenceposts that you need for a given fence. For example, if you have to put up a fence 100 feet long and each section of the fence is 10 feet long, how many sections of fence do you need? Obviously, the answer is 10. Now, how many fenceposts do you need? 11. The confusion caused by counting fenceposts when you should be counting segments of fence (and vice versa) is the cause of a fencepost error. To return to a programming example, if you have a vector with 11 elements, the index of the last element is 10, not 11. Confusing the number of elements with the highest index has much the same effect as that of the fencepost problem. This sort of problem is also known, less colorfully, as an off-by-one error.

Field; see manipulator.

A float is a type of floating-point variable that can represent a range of positive and negative numbers, including fractional values. With most current C++ compilers, including the one on the CD in the back of the book, these numbers can vary from approximately 1.401298e – 45 to approximately 3.40282e + 38 (and 0), with approximately 6 digits of precision.

A floating-point variable is a C++ approximation of a mathematical “real number”. Unlike mathematical real numbers, C++ floating-point variables have a limited range and precision depending on their types. See the individual types float and double for details.

A for statement is a loop control statement that causes its controlled block to be executed while a specified logical expression (the continuation expression) is true. It also provides for a starting expression to be executed before the first execution of the controlled block and for a modification expression to be executed after every execution of the controlled block. For example, in the for statement for (i = 0; i < 10; i ++), the initialization expression is i = 0, the continuation expression is i < 10, and the modification expression is i ++.

A form-feed character, when sent to a printer, causes the paper to be advanced to a new page.

The free store is the area of memory where variables of the dynamic storage class store their data.

The keyword friend allows access by a specified class or function to private or protected members of a particular class.

A function is a section of code having a name, optional arguments, and a return type. The name makes it possible for one function to start execution of another one via a function call. The arguments provide input for the function, and the return type allows the function to provide output to its calling function when the return statement causes the calling function to resume execution.

A function call (or call for short) causes execution to be transferred temporarily from the current function (the calling function) to the one named in the function call (the called function). Normally, when a called function is finished with its task, it returns to the calling function, which picks up execution at the statement after the function call.

A function declaration tells the compiler some vital statistics of the function: its name, its arguments, and its return type. Before we can use a function, the compiler must have already seen its function declaration. The most common way to arrange for this is to use a #include statement to insert the function declaration from a header file into an implementation file.

Function header; see function declaration.

Function overloading is the C++ facility that allows us to create more than one function with the same name. So long as all such functions have different signatures, we can write as many of them as we wish and the compiler will be able to figure out which one we mean.

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

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