title: C++ Read Access violation error
body: <p>I am currently getting an "0xC0000005: Access violation reading location 0xcccccce0." error and I have tried diagnose the problem...I think the problem comes in when my rule of 3 that I have defined comes in play and points me to here.</p>
  
  <pre><code>size_type size() const
      {   // return length of sequence
      return (this-&gt;_Mysize); &lt;---------------------this line
      }
  </code></pre>
  
  <p>I'm actually not sure if there is any problem at all, I have been dwelling on this for days on end.</p>
  
  <p>Below is my rule of three</p>
  
  <pre><code>ArrayStorage::ArrayStorage(){
       myArray = new string[7079];
  }
  
  ArrayStorage::~ArrayStorage(){
      delete[] _data;
      delete[] myArray;
  }
  
  ArrayStorage::ArrayStorage(const ArrayStorage &amp;A) {
      _size = A.size();
      _data = new string [size()];
      for (int i = 0; i &lt; size(); ++i)
          _data[i] = A[i];
  }
  
  ArrayStorage&amp; ArrayStorage::operator=(const ArrayStorage &amp;A){
      if (this != &amp;A) {
          delete [] _data;
          _size = A.size();
          _data = new string [A.size()];
          for (int i = 0; i &lt; size(); ++i) {
               _data[i] = A[i];
          }
      }
      return *this;
  }
  
  const string&amp; ArrayStorage::operator[](int i) const{
      assert((i &gt;= 0) &amp;&amp; (i &lt; size()));
      return _data[i];
  }
  
  string&amp; ArrayStorage::operator[](int i){
      assert((i &gt;= 0) &amp;&amp; (i &lt; size()));
      return _data[i];
  }
  </code></pre>