Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Az övé:
- Line::Line(const Line &obj) {
- cout << "Copy constructor allocating ptr." << endl;
- ptr = new int;
- *ptr = *obj.ptr; // copy the value
- }
- Line::~Line(void) {
- cout << "Freeing memory!" << endl;
- delete ptr;
- }
- //Az enyém:
- /// Másoló konstruktor
- Vektor::Vektor(const Vektor& v1) {
- pVec = new double;
- *pVec = *v1.pVec;
- }
- /// Destruktor
- Vektor::~Vektor(){
- delete[] pVec;
- }
Advertisement
Add Comment
Please, Sign In to add comment