Thanks for spending some time going through my code and help out. Have some k

I tried this:
guests *rooms::GetGuest() {return p;}But it wouldnt work for me

I think it has something to do with the pointer being dereferenced when it is passed from the function. I have just read something dereferencing
hereThe dereference operation starts at the pointer and follows its arrow over to access its pointee. The goal may be to look at the pointee state or to change the pointee state.
The dereference operation on a pointer only works if the pointer has a pointee -- the pointee must be allocated and the pointer must be set to point to it. The most common error in pointer code is forgetting to set up the pointee. The most common runtime crash because of that error in the code is a failed dereference operation. In Java the incorrect dereference will be flagged politely by the runtime system. In compiled languages such as C, C++, and Pascal, the incorrect dereference will sometimes crash, and other times corrupt memory in some subtle, random way. Pointer bugs in compiled languages can be difficult to track down for this reason.
If NULL means that the pointer points to nothing, then it seems as if my code will not work at all, but the prog should at least compile, then crash.
The only way I have been able to get it to compile is by doing:
guests rooms::GetGuest() { return *p; }then:
if(&room[i].GetGuest() != NULL)and it crashes at the if statement.
Maybe I could set the pointers to point some variable thats memory address represents that there is no guest in the room. I don't know if that would be a bad idea tho.
Also, from what I experience, It dosent seem as if what you said about the array sizes was correct. I remembered coding a bubble sort in C using array entry 0 as a temp variable. I just wrote a short test example:
#include <stdio.h>
int array[10];
int main()
{
for(int i=0; i<=10; i++) array[i]=i, printf("%i", array[i]);
getchar(), getchar();
} I use Dev-C++ and it works for me. Maybe different compilers interpret C differently or something.