Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include "c.h"
  2.  
  3. c::c() {
  4.     this->v = new int[2];
  5. }
  6.  
  7. c::c(c const& other) {
  8.     this->v = new int[2];
  9.     for (size_t index = 0; index < 2; index++) {
  10.         this->values[index] = other.values[index];
  11.     }
  12. }
  13.  
  14. c& c::operator=(c const& other) {
  15.     delete [] this->values;
  16.     this->values = new int[capacity];
  17.     for (size_t index = 0; index < 2; index++) {
  18.         this->v[index] = other.v[index];
  19.     }
  20.     return *this;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement