What is the rule for declaration before use in C++?
<p>My course notes say "C++ requires declaration before use in a block and among types but not within a type."</p>

<p>Is this what it means?</p>

<pre><code>int f() {
   if (i)
     return i;
   int i = 1; //allowed?
   return 0;

}

//not allowed?
int g() {
    if (i)
      return i;
    return 0;
}

int i = 1; 
</code></pre>
