@@ .h #ifndef PAKOLTTOMB_H_ #define PAKOLTTOMB_H_ class PakoltTomb { private: unsigned char* t; int sz; class Elem; void setelement(int, unsigned char); unsigned char getelement(int); public: @@ PakoltTomb(int,int); PakoltTomb(const PakoltTomb&); int len(); Elem& operator[](int x); PakoltTomb& operator=(const PakoltTomb&); ~PakoltTomb(); private: class Elem { friend class PakoltTomb; private: PakoltTomb* owner; int index; static Elem* temp; Elem(); Elem(PakoltTomb*,int); public: Elem& operator=(unsigned char); Elem& operator=(Elem&); operator unsigned char(); }; }; #endif /*PAKOLTTOMB_H_*/ @@ .cpp #include "PakoltTomb.h" #include using namespace std; int main() { @@ @@ PakoltTomb x; @@ try { x = PakoltTomb(5,14); x[1] = x[2] = x[8] = 1; x[3] = x[4] = 3; x[7] = x[3]; for(int i=0;i