    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: The Wall</title>
        <link>http://accu.org/index.php/journals/1027</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 12, #4 - Jul 2000 + Letters to the Editor</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="http://accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="http://accu.org/index.php/journals/c76/">Journals</a>

                     &gt;                         <a href="http://accu.org/index.php/journals/c77/">CVu</a>

                     &gt;                         <a href="http://accu.org/index.php/journals/c125/">124</a>
                    (22)
<br />

                                            <a href="http://accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="http://accu.org/index.php/journals/c184/">Journal Columns</a>

                     &gt;                         <a href="http://accu.org/index.php/journals/c186/">LettersEditor</a>
                    (123)
<br />

                                            <a href="http://accu.org/index.php/journals/c125-186/">Any of these categories</a>

                    -                        <a href="http://accu.org/index.php/journals/c125+186/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;The Wall</h1>
<p><strong>Author:</strong>&nbsp;Administrator</p>
<p>
<strong>Date:</strong> 08 July 2000 13:15:38 +01:00 or Sat, 08 July 2000 13:15:38 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id="d0e22"></a>I did not
know&hellip;</h2>
</div>
<p>Dear Francis,</p>
<p>This is an interesting one, I have just found this out whilst
using Visual Studio 6 SP3.</p>
<pre class="programlisting">
int main() {
  int iVal;
  iVal = 1; 
  {
    printf(&quot;iVal == %d\n&quot;, iVal);
    int iVal = 2;
    printf(&quot;iVal == %d\n&quot;, iVal);
  }
  printf(&quot;iVal == %d\n&quot;, iVal);
  return 0;
}
</pre>
<p>Output is:</p>
<pre class="screen">
1
2
1
</pre>
<p>I was not actually aware that you could do this in C++, and just
spotted it as a typo during a code review, declaring a duplicate
variable appears to hide the outer scope declaration, could be
nasty. I would expect a warning to be raised but Visual Studio does
not display any warning at all even with the warning level set to
4, I trust this is not right! :-)</p>
<p>NB. I have gone through the list of warnings VS uses and there
does not appear to be any applicable one listed, this behaviour
also happens in C and C++ mode.</p>
<p>Darren Jefford</p>
<p class="c3"><span class="remark">The code you provide is
faultless C++ though a C compiler should have thrown it out because
a declaration after an executable statement at block scope. Note
the past tense, the new C standard allows late
declarations.</span></p>
<p class="c3"><span class="remark">This hiding rule has always been
the case. Reusing an identifier in an inner scope hides the one in
the outer scope. C++ provides mechanisms for referring to the
hidden name if that was declared at global, namespace or class
scope.</span></p>
<p class="c3"><span class="remark">In strictly conforming mode a
C++ compiler must not issue a diagnostic (though it is up to the
implementers to determine whether a warning constitutes a
diagnostic). However, I would expect a quality compiler to issue a
warning for declaring a name that had already been used in the
current scope to refer to something in an outer scope.
FG.</span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
