title: c++ overloading >> operator
body: <p>I want to add <code>&gt;&gt;</code> overloading to my class but when I compile it, the compiler gives me this error:</p>
  
  <pre><code>In function 'std::istream&amp; operator&gt;&gt;(std::istream&amp;, const Dogru&amp;)':
  [Error] ambiguous overload for 'operator&gt;&gt;' (operand types are
          'std::istream {aka std::basic_istream&lt;char&gt;}' and 'const int')
  </code></pre>
  
  <p>I made <code>&lt;&lt;</code> overloading without problems, but with <code>&gt;&gt;</code> it is not working.</p>
  
  <p>The part of my code:</p>
  
  <pre><code>    class Dogru{
      private:
          int yon_x, yon_y, yon_z;
      public:
          friend istream&amp; operator&gt;&gt; (istream &amp;in, const Dogru &amp;dog);
      };
      istream&amp; operator&gt;&gt; (istream &amp;in, const Dogru &amp;dog){
          in &gt;&gt; dog.yon_x;
          in &gt;&gt; dog.yon_y;
          in &gt;&gt; dog.yon_z;    
          return in;
      }
  
      int main(){
           Dogru al;
           cout &lt;&lt; "Enter al's x y z:";
           cin &gt;&gt; al;
           return 0;
      }
  </code></pre>