Problem with "not declared in this scope" error
<p>I've got:</p>

<blockquote>
  <p>error a1 was not declared in this scope</p>
</blockquote>

<p>Can somebody please explain why this code causes that?</p>

<h3>quiz.h</h3>

<pre><code>#ifndef QUIZ_H_
#define QUIZ_H_

    #include "quiz.cpp"   // I deleted this row
                          // and wrote void quiz(int i);


    class A {
    private:
        int player;
    public:
        A(int initPlayer);  // wrote here = 0
        ~A();
        void foo();
    };


    #endif /* QUIZ_H_ */
</code></pre>

<h3>quiz.cpp</h3>

<pre><code>#include "quiz.h"
#include &lt;iostream&gt;
using std::cout;
using std::endl;

A::A(int initPlayer = 0){    // deleted = 0
    player = initPlayer;
}

A::~A(){

}

void A::foo(){
    cout &lt;&lt; player;
}
</code></pre>

<h3>main function</h3>

<pre><code>#include "quiz.h"
int main()
{
        quiz(7);
        return 0;
}
</code></pre>

<h3>quiz function</h3>

<pre><code>#include "quiz.h"

void quiz(int i)
{
        A a1(i);
        a1.foo();
}
</code></pre>

<p>after my modifications I have an error <code>multiple definition of quiz(int)</code></p>
