Last active
February 8, 2017 17:32
-
-
Save camilajenny/29b7318699aabddad5c08d32f37f28b2 to your computer and use it in GitHub Desktop.
pojazd<|-samochod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
using namespace std; | |
class Pojazd { | |
private: | |
string lusterko[3] = {"lewe", "prawe"}; | |
public: | |
//friend class Samochod; | |
Pojazd& operator=(const Pojazd&); | |
}; | |
Pojazd &Pojazd::operator=(const Pojazd& pojazd) { | |
return *this; | |
} | |
class Samochod : Pojazd { | |
public: | |
Samochod& operator=(const Samochod&); | |
}; | |
Samochod &Samochod::operator=(const Samochod &wzor) { | |
if (this != &wzor) | |
{ | |
(Pojazd&)*this = wzor; | |
this->lusterko[2] = "wsteczne"; | |
} | |
return *this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error in line 26: private 'Pojazd::lusterko' is inaccessible