Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1.  Test & operator = (const Test& other)
  2.     {
  3.         if(this != & other)
  4.         {
  5.             if(other.dataRowsLength > 0)
  6.             {
  7.                 DataTable* newRows = new DataTable[other.dataRowsLength];
  8.                 copy(other.dataRows, other.dataRows + other.dataRowsLength, newRows);
  9.                
  10.                 delete[] dataRows;
  11.                
  12.                 dataRowsLength = other.dataRowsLength;
  13.                 dataRows = newRows;
  14.             }
  15.             else
  16.             {
  17.                 delete[] dataRows;
  18.             }
  19.         }
  20.         return * this;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement