#ifndef _ORDER_H_
#define _ORDER_H_
#include "date.h"
#include "room_node.h"
#include "room_list.h"
class Order{
public:
//..
void print_order_info();
void add_room_to_order(int num_of_beds);
string get_check_in_date();
string get_check_out_date();
int get_owner_id();
int get_order_id();
private:
int num_of_rooms,i,found;
Room_Node* nextRoomNode;
Room* nextRoom;
int _order_id;
int _owner_id;
int _num_of_nights;
longint _new_num_of_nights;
Date _new_check_in;
Date _new_check_out;
Date _check_in;
Date _check_out;
};
#endif
Room_List is a class and get_first is a method. method is a function that can operate on this pointer. Then you call a method, the identifier before . or -> specifies what this will be. You can think of it as another argument. Now you call get_first without specifying what object will be this, while get_first needs to know it.
If get_first didn't need to know it you could declare it static, however it clearly does (it returns this->firstRoomNode ).
The problem in your code is that Object has no knowledge of any Room_List so it can't pass anything as this. You could either add a member my_room_list of type Room_List and change Room_List:: to my_room_list. . Or you could have Order inherit from Room_List (I cannot know if that would make sense though) so that this from add_room_to_order can be used in get_first.