Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Matrix(const Matrix &other) {
  2. rows = other.rows;
  3. columns = other.columns;
  4. data = new T * [rows];
  5. for (size_t i = 0; i < rows; ++i) {
  6. for (size_t j = 0; j < columns; ++j) {
  7. data[i][j] = other.data[i][j];
  8. }
  9. }
  10. }
  11.  
  12. Matrix& operator= (const Matrix& other) {
  13. rows = other.rows;
  14. columns = other.columns;
  15. data = new T * [rows];
  16. for (size_t i = 0; i < rows; ++i) {
  17. for (size_t j = 0; j < columns; ++j) {
  18. data[i][j] = other.data[i][j];
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement