Computer terminology that appears in C + + 2

Source: Internet
Author: User
Tags goto terminates

C-style strings (C-style string)

The C program treats a pointer to an array of characters ending with a null character as a string. In C + +, string literals are C-style strings. The C standard library defines a series of library functions that handle such strings, which are placed in the CString header file in C + +. Because C-style strings are inherently easy to make mistakes, C + + programs should take precedence over C + + standard library class string and use less of a style string. A large number of security vulnerabilities in network programs are due to defects related to the use of C-style strings and arrays.

Compiler extension (compiler Extension)

A specific compiler is a language-joined feature. Programs that rely on compiler extensions are very difficult to port to other compilers.

Compoundtype (composite type)

Use a type defined by another type. arrays, pointers, and references are composite types.

Const void*

Pointer type that can point to a random const type, see void *.

Delete expression (delete expressions)

The delete expression is used to free memory allocated dynamically by NEW: delete [] p;

In this expression, p must be a pointer to the first element in the dynamically created array, when the brackets are indispensable: it tells the compiler that the pointer is pointing to an array, not a single object. C + + programs use Delete instead of the standard library function of the C language free.

Dimension (number of dimensions)

The array size.

Dynamic allyallocated (dynamically assigned)

The object that is established in the free store of the program. Once created, the object persists until it is explicitly released.

Free Store

The memory area that the program uses to store dynamically created objects.

Heap (heaps)

A synonym for a free storage area.

New expression (new expressions)

An expression that is used to allocate dynamic memory. The following statement assigns an array of n elements: new type[n];

The array holds elements of type types. New returns a pointer to the first element of the array. C + + programs use new instead of the C language standard library function malloc.

Pointer (pointer)

The object that holds the address of the object.

pointer arithmetic (pointer arithmetic operation)

Arithmetic operations that can be used for pointers. Agree to do an operation that adds or subtracts an integer value on the pointer to get the address at a number of elements before or after the current pointer. Two pointers can be subtracted to get the difference between them. The arithmetic operation of a pointer is only meaningful when the pointer points to the same array or to its position beyond the end.

Precedence (Priority level)

In complex expressions, the precedence determines the order in which the operands are grouped.

ptrdiff_t

A machine-related signed integer defined in the Cstddef header file that has enough size to store the difference of two pointers that point to the same possible maximum array.

size_t

The machine-related unsigned integer defined in the Cstddef header file, which has enough size to store a possible maximum array.

*operator (* operator)

Dereference the pointer to the object that the pointer points to. The dereference operator returns an lvalue, so it can be assigned a value that is equivalent to assigning a new value to the specific object that the pointer points to.

++operator (+ + operator)

When used for pointers, the increment operator gives the pointer "plus 1", moving the pointer to the next element of the array.

[]operator ([] operator)

The subscript operator accepts two operands: one is a pointer to an array element, and one is subscript N. This action returns the value of an element that deviates from the current pointer to n positions. The array subscript starts at 0--the subscript of the first element of the array is 0, and the last element's subscript is the array length minus 1. The subscript operation returns an Lvalue, which can be used as the left operand of an assignment operation, equivalent to assigning a new value to the element referenced by the subscript.

&operator (& operator)

The fetch address operator requires an operand whose only operand must be an Lvalue object, which returns the storage address of the operand object in memory.

void*

Pointer type that can point to whatever non-const object. The void* pointer provides only a limited number of operations: it can be used as a function type or return type, or as a comparison to other pointers, but cannot be dereferenced

Assert

A pre-processing macro that uses a single expression as the assertion condition. Assuming that the preprocessing variable ndebug is undefined, assert solves its conditional expression. If the condition is False,assert output information and terminate the program's operation.

Block (Blocks)

A sequence of statements included in a pair of curly braces. In syntax, a block is a single statement that can appear wherever a single statement is now available.

Break statement (break statement)

A statement that terminates the operation of a recent loop or switch statement, handing over control to the terminated loop or to the first statement after the switch.

Case label (case label)

The integer constant value following the keyword case in the switch statement. In the same switch structure, no matter what two labels have the same constant value. Assuming that the value of the switch condition expression is equal to the value of one of the labels, the control is transferred to the first statement following the matching label, from which the statement proceeds to continue the individual statements until it encounters a break or arrives

Switch ends.

Catch clause (catch clause)

A statement that contains the keyword catch, the exception specifier in parentheses, and a block statement. The code in the catch clause implements the handling of an exception, which is defined by the exception specifier inside the parentheses.

Compound statement (compound statement)

A synonym for a block.

Continue statement (continue statement)

A statement that can end the current iteration of a recent looping structure, transfer the control flow to a loop condition expression for a while or do, or the third expression in a For statement header. Dangling else (overhanging else) a popular term that indicates how to handle the two semantics of if more than else in a nested if statement. In C + +, else is always paired with a recent unmatched if. Note that using curly braces effectively hides the inner if, allowing the program ape to control which if the given else is matched.

Declaration statement (Declaration statement)

A statement that defines or declares a variable. The declaration is described in chapter II.

Default label (default label)

A label in a switch statement, when the value derived from the switch condition is computed with all case

When the value of the label does not match, the statement associated with the default label is run.

Exception classes (Exception Class)

The standard library defines a set of classes that describe the error of a program. Table 6.1 lists the common exceptions.

Exception handler (Exception handling code)

A piece of code that handles exceptions caused by some part of the program. is a synonym for a catch clause.

Exception specifier (exception specifier)

The declaration of an object or type that indicates the type of exception that the current catch can handle.

Expression statement (Expressions statement)

A statement consisting of an expression followed by a semicolon. Expression statements are used for the solution of an expression.

Flow of control (flow)

The running path of the program.

Goto statement (Goto statement)

A statement that allows the program control process to jump unconditionally to a specified label statement. Goto disrupts the control flow inside the program and should be avoided as much as possible.

If Else statement (if Else statement)

A statement that conditionally runs the code after if or else, and how it is run depends on the truth value of the conditional expression.

If statement (if statement)

A conditional branching statement based on a specified condition value. If the condition is true, run the IF statement body; otherwise, control the statement that flows to the IF.

Labeled statement (labeled statement)

The statement that begins with a label. The label is an identifier followed by a colon.

Null statement (empty statement)

A blank statement. Its grammatical form is a single semicolon.

Preprocessor macro (preprocessing macros)

A function similar to the facility defined by the preprocessor. Assert is a macro. Modern C + + programs use very little preprocessing macros.

Raise (raised)

Often used as a synonym for throw. C + + program The ape says "throw (throwing)" or "throw (raising)" an exception to indicate the same meaning.

Switch statement (switch statement)

The conditional branch statement that runs from the expression after the calculation of the keyword switch is started. The control flow of the program jumps to the label statement labeled by the case label that matches the expression value. Assuming there is no matching label, the branch running the default label tag is run, assuming that the default branch is not provided to end the switch statement.

Terminate

Standard library functions that are called when an exception is not captured. Generally terminates the operation of the program. The throw expression breaks the expression of the current running path. Each throw throws an object and transforms the control to a recent catch clause that handles the type of exception.

try block (try blocks)

The block following the keyword try, and one or more catch clauses. Assuming that the code in the try block produces an exception, and that the exception type matches one of the catch clauses, the statement that runs the catch clause handles the exception. Otherwise, the exception is handled by the perimeter try block, or the program is terminated.

While loop

When the specified condition is true, the control statement for the target code is run. Depending on the truth of the condition, the target code may run 0 or more times.

Computer terminology that appears in C + + 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.