first of all, that is a reference to foo, not a pointer to foo. second of all, i know that! let me explain:
here is what my code is like:
Code:
struct ROOM
{
ROOM* north;
ROOM* west;
ROOM* east;
ROOM* south;
//...etc
};
//now i declare 55 variables of type ROOM:
ROOM room1;
ROOM room2;
ROOM room3;
ROOM room4;
//....etc until room55
//now this is how i pass the variables:
void func(ROOM& room1, ROOM& room2, ROOM& room3)//...til 55
are you saying that i can pass all the variables of type room by doing something like passing ROOM when called in main, and use &ROOM for the prototype and definition? so....:
Code:
void func(&ROOM); //prototype
//in main
func(ROOM);
//definition
void func(&ROOM)
{
//blah blah, being able to use all 55 of my 'ROOM's?
}
is that possible?