Skip to content

Instantly share code, notes, and snippets.

@banan314
Last active February 8, 2017 17:32
Show Gist options
  • Save banan314/29b7318699aabddad5c08d32f37f28b2 to your computer and use it in GitHub Desktop.
Save banan314/29b7318699aabddad5c08d32f37f28b2 to your computer and use it in GitHub Desktop.
pojazd<|-samochod
#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;
}
@banan314
Copy link
Author

banan314 commented Feb 8, 2017

error in line 26: private 'Pojazd::lusterko' is inaccessible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment