title: does assignment operator work with different types of objects?
body: <pre><code>class A {
  public:
  void operator=(const B &amp;in);
  private:
   int a;
  };
  
  class B {
  private:
   int c;
  
  }
  </code></pre>
  
  <p>sorry. there happened an error. is assignment operator valid ? or is there any way to achieve this? [There is no relation between A and B class.]</p>
  
  <pre><code>void A::operator=(const B&amp; in) 
  { 
  a = in.c;
  
  } 
  </code></pre>
  
  <p>Thanks a lot. </p>