Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class Type,int p>
- class Collection
- {
- private:
- Type* niz;
- int n;//added this just in case
- public:
- Collection();
- ~Collection();
- bool Find(Type t);//checks if the t is in the array with operator!=
- void Arrange();//arranges the array
- void Reverse();//swithces the first memmber of array to the last and the second to p-2
- void Set(int i,Type t);//should set t to the niz[i]
- void SaveElement(int i, char* Dat);//this is for saving in a file
- void ReedElement(char*Dat);//this is for printing on the screan from a file
- //bool operator!=(Type& t,Type& a);//visual studio is telling me 2 many arguments,dont know why
- };
- class Hotel
- {
- private:
- char*HotelName;
- int numRooms, openedYear,catagoryHotel;
- public:
- Hotel();
- ~Hotel();
- void SetHotel();
- //bool operator <=(Hotel& h1, Hotel& h2);this for some reason doesnt work also
- };
- //In my constructor for Collection i typed
- template<class Type, int p>
- inline Collection<Type, p>::Collection()
- {
- n = p;
- niz = new Type[n];
- }
- //in the constructor for Hotel() i typed
- Hotel::Hotel()
- {
- HotelName = "Undenfined";
- catagoryHotel = 0;//how much stars it has
- openedyear = 0;
- numRooms = 0;
- }
Add Comment
Please, Sign In to add comment