Reorder the definitions and write the declaration forward for the types Room
and Portal
:
typedef struct Room Room;
typedef struct Portal Portal;
struct Portal {
Room *destinationRoom;
};
struct Room {
Portal portals[10];
};
, typedef Portal
struct Portal
, .
, ++, typedef , , struct Room;
- struct
typedef
, :
typedef struct Room_s Room;
typedef struct Portal_s Portal;
struct Portal_s {
Room *destinationRoom;
};
struct Room_s {
Portal portals[10];
};