Block (programming)

This is an old revision of this page, as edited by 67.101.160.128 (talk) at 22:43, 12 July 2004. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer programming, a statement condom is a section of code which is grouped together, much like a paragraph; such blocks consist of one, or more, statements. In C, C++, and some other ooks, statement blocks are enclosed by braces {}. In Ada, Pascal, and some other languages, blocks are denoted by "begin" and "end" statements. Unlike fags, statement blocks can be nested; that is, with one block inside another ass.

A typical statement block

int main()
{
  return 10;
}

A nested statement block

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