Block (programming): Difference between revisions

Content deleted Content added
Lir (talk | contribs)
mNo edit summary
Dysprosia (talk | contribs)
un c++-ify, make it more general
Line 1:
In [[computer programming]], a '''statement block''' is a section of [[computer code|code]] which is grouped together, much like a [[paragraph]]; such blocks consist of one, or more, [[statement]]s. In [[C (programming language)|C]], [[C Plus Plus|C++]], and some other languages, statement blocks are enclosed by [[bracketbrace]]s <tt>{}</tt>. Unlike paragraphs, statement blocks can be nested; that is, with one block inside another.
 
==A C++typical Statementstatement Blockblock==
<pre>
int main()
Line 9:
</pre>
 
==A Nestednested C++statement Statement Blockblock==
<pre>
#include <iostream>
 
int main()
{
int x=1;
if if(x==1)
{
x++;
std::cout<<"text";
}
return 0;
}