Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
4 user(s) are online (4 user(s) are browsing encyclopedia)

Members: 0
Guests: 4

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Statement block

In computer programming, a statement block is a section of computer code which is grouped together, much like a paragraph; such blocks consist of one, or more, statements. In C (programming language), C plus plus, and some other languages, statement blocks are enclosed by brackets {}. In Ada programming language, Pascal programming language, and some other languages, blocks are denoted by begin and end statements. In Python programming language they are indicated by indentation. Unlike paragraphs, statement blocks can be nested; that is, with one block inside another. Blocks often define the Scope_(programming) of the identifiers used within.

Blocks often have subtle but important differences in semantics. In languages in the C tradition, they define identifier scope. In C++ they can be used to define object lifetime (creation and destruction). In some languages (such as Pico (programming language)) they are merely used for grouping expressions without notions of variable scope. In languages such as Smalltalk, blocks are objects in their own right, extended with a reference to their environment of definition, i.e. closure (computer science).

=A typical statement block=

int main() { return 0; }

=A nested statement block=

int main() { int x=1; if(x==1) { x++; } return 0; }