RAD Studio |  |

Statements
Collapse All

This section contains Statement topics.

Topics

Name | Description
Blocks | A compound statement, or block, is a list (possibly empty) of statements enclosed in matching braces ({ }). Syntactically, a block can be considered to be a single statement, but it also plays a role in the scoping of identifiers. An identifier declared within a block has a scope starting at the point of declaration and ending at the closing brace. Blocks can be nested to any depth up to the limits of memory.
C++ Specifics | C++ is an object-oriented programming language based on C. Generally speaking, you can compile C programs under C++, but you can’t compile a C++ program under C if the program uses any constructs specific to C++. Some situations require special care. For example, the same function func declared twice in C with different argument types causes a duplicated name error. Under C++, however, func will be interpreted as an overloaded function; whether or not this is legal depends on other circumstances. Although C++ introduces new keywords and operators to handle classes, some of the capabilities of C++ have applications outside... more
Expression Statements | Any expression followed by a semicolon forms an expression statement:
Iteration Statements | Iteration statements let you loop a set of statements. There are three forms of iteration in C++: while, do while, and for loops.
Jump Statements | A jump statement, when executed, transfers control unconditionally. There are four such statements: break, continue, goto, and return
Labeled Statements | A statement can be labeled in two ways: label-identifier : statement * The label identifier serves as a target for the unconditional goto statement. Label identifiers have their own name space and have function scope. In C++ you can label both declaration and non-declaration statements. case constant-expression : statement * default : statement Case and default labeled statements are used only in conjunction with switch statements.
Selection Statements | Selection or flow-control statements select from alternative courses of action by testing certain values. There are two types of selection statements: the if...else and the switch.
Statements | Statements specify the flow of control as a program executes. In the absence of specific jump and selection statements, statements are executed sequentially in the order of appearance in the source code. CodeGear C++ statements shows the syntax for statements. CodeGear C++ statements

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!