<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://wiki.lostsouls.org/w/skins/common/feed.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Man block - Revision history</title>
		<link>http://wiki.lostsouls.org/w/index.php?title=Man_block&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.8.2</generator>
		<lastBuildDate>Tue, 05 May 2026 14:02:27 GMT</lastBuildDate>
		<item>
			<title>Laine at 19:10, 11 June 2007</title>
			<link>http://wiki.lostsouls.org/w/index.php?title=Man_block&amp;diff=3953&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Description==&lt;br /&gt;
&lt;br /&gt;
A block is a special statment, that begins with '{', contains&lt;br /&gt;
a list of statements, and ends with '}'.&lt;br /&gt;
&lt;br /&gt;
The block may define local variables. If for a variable no&lt;br /&gt;
initialisation is given, the variable is initialised to 0 every&lt;br /&gt;
time the block is entered. Otherwise, the initialisation&lt;br /&gt;
expression is evaluated and its result assigned to the variable&lt;br /&gt;
everytime the block is entered.&lt;br /&gt;
&lt;br /&gt;
Example definitions are:&lt;br /&gt;
&lt;br /&gt;
  int i;&lt;br /&gt;
  int j = 3;&lt;br /&gt;
  int k = 3 * j, l;&lt;br /&gt;
&lt;br /&gt;
Here, i and l are both initialised to 0; j is initialised&lt;br /&gt;
to 3, and k is initialised to 9 (3 * j).&lt;br /&gt;
&lt;br /&gt;
Local variables defined in a block are visible only until the&lt;br /&gt;
end of the block. Definitions in an inner block hide definitions in&lt;br /&gt;
outer blocks.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
Up to 3.2.7, local variables were visible (from their point of&lt;br /&gt;
definition) in the whole function. That is, code like&lt;br /&gt;
&lt;br /&gt;
    do {&lt;br /&gt;
        int res;&lt;br /&gt;
&lt;br /&gt;
        res = ...&lt;br /&gt;
    } while (res == 5);&lt;br /&gt;
    write(res);&lt;br /&gt;
&lt;br /&gt;
was perfectly legal. It is no longer, as 'res' ceases to exist&lt;br /&gt;
with the closing '}' of the while().&lt;br /&gt;
&lt;br /&gt;
You can get this old behaviour back with the #pragma no_local_scopes.&lt;br /&gt;
To turn it off again, use #pragma local_scopes.&lt;br /&gt;
&lt;br /&gt;
Up to 3.2.8, local variables could not be initialised in their&lt;br /&gt;
definition.&lt;/div&gt;</description>
			<pubDate>Mon, 11 Jun 2007 19:10:23 GMT</pubDate>			<dc:creator>Laine</dc:creator>			<comments>http://wiki.lostsouls.org/Talk:Man_block</comments>		</item>
	</channel>
</rss>