title: Trying to assign value to *this pointer fails
body: <p>I got this program in C++ and it works perfectly fine if I put last 2 lines in comment:
  <code>a = b;</code>
  <code>MyAr c(b);</code>
  I tested it with a method that I deleted it. The problem is with the <code>*this</code> pointer I think, when I compile and run the program flashes for a moment and then disappears. Can you please help me? Thanks!</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class MyAr {
      int *p;
      int len;
      public:
          MyAr();
          MyAr(int a);
          MyAr(const MyAr&amp; ob);
          ~MyAr();
  
          MyAr&amp; operator=(const MyAr&amp; ox) { *this = ox; }
          int&amp; operator[](int i) { return p[i]; }
          int length();
  };
  
  MyAr::MyAr() : p(0), len(0) {}
  MyAr::MyAr(int a) : p(new int[a]), len(a) {}
  MyAr::MyAr(const MyAr&amp; ob) { *this = ob; }
  MyAr::~MyAr() { delete p; }
  
  int MyAr:: length(){
      return len;
  }
  
  int main(){
  
      MyAr a;
      MyAr b(10);
      for(int i=0; i&lt; b.length(); ++i)
          b[i] = i;
  
      a = b;
      MyAr c(b);
  
      system("pause");
      return(0);
  }
  </code></pre>