I have an object Room and each Room has an array of 4 references to other rooms
header file:
namespace test
{
class Room
{
public:
Room* references[4];
void Connect(Room roomReference) const;
}
}
Run Code Online (Sandbox Code Playgroud)
and in my cpp file, I am attempting to attach that reference by inserting the pointer of the room to a specific index in references. However, I get the following compiler error "Cannot assign to readonly type Room* const." But when I create a local variable …