title: declaration syntax error
body: <p>What's wrong with this one? The compiler says: Declaration syntax error.</p>
  
  <p>Source File:</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int main(int argc, char **argv) {
      void printBinary(const unsigned char val) {
          //printBinary() func. outputs byte in binary
          for(int i=7;i&gt;=0;i--)
              if(val &amp; (1&lt;&lt;i))  //generates a single bit with offset position
                  std::cout&lt;&lt;"1";
              else
                  std::cout&lt;&lt;"0"
      }
      return 0;
  }///:~
  </code></pre>
  
  <p>Header file:</p>
  
  <pre><code>void printBinary(const unsigned char val);
  ///:~
  </code></pre>