I/O operator overloading error in C++
<p>please, perhaps, I am too tired cuz I can't seem to figure out why this input stream operator overloaded function is complaining..here is the .h declaration:</p>

<pre><code>friend std::istream&amp; operator&gt;&gt;(std::istream&amp; in,  IntOperatorClass&amp; intoperatorClass)
</code></pre>

<p>and here is the .cpp declaration:</p>

<pre><code>std::istream&amp; operator &gt;&gt;(std::istream&amp; in,  IntOperatorClass&amp; intoperatorClass)
     {
         in&gt;&gt;intoperatorClass.value;
         return in;
     }
</code></pre>

<p>the class has one private variable called value..</p>

<p>the class :</p>

<pre><code>class IntOperatorClass{
     int value; //a value
     int arr[10];//an array value
 public:
     IntOperatorClass();//default constructor
     IntOperatorClass(int);//constructor with parameter
     IntOperatorClass(int arr[], int length);//an array constructor
     IntOperatorClass(const IntOperatorClass&amp; intoperatorClass);//copy constructor
     IntOperatorClass&amp; operator=(const IntOperatorClass&amp; intoperatorClass);//assignment operator
     friend std::ostream&amp; operator &lt;&lt;(std::ostream&amp; out,  const IntOperatorClass&amp; intoperatorClass);//output operator;
     friend std::istream&amp; operator&gt;&gt;(std::istream&amp; in,  IntOperatorClass&amp; intoperatorClass);//input operator
     IntOperatorClass&amp; operator++();//pre increment operator
     IntOperatorClass operator++(int);//post increment operator
     friend IntOperatorClass operator+(const IntOperatorClass intoperatorClassFirst , const IntOperatorClass intoperatorClassSecond);
     int GetValue(){return value;}
 };
</code></pre>

<p>is there something I am doing wrong because the compiler keeps complaining that the ">>" is not defined..</p>

<pre><code>./op.cpp: In function 'std::istream&amp; operator&gt;&gt;(std::istream&amp;, IntOperatorClass&amp;)':
../op.cpp:77: error: no match for 'operator&gt;&gt;' in 'in &gt;&gt; intoperatorClass-&gt;IntOperatorClass::value'
../op.cpp:75: note: candidates are: std::istream&amp; operator&gt;&gt;(std::istream&amp;, IntOperatorClass&amp;)
</code></pre>
