Passing a pointer to a struct
The book I have on this is completely useless (even it's examples don't work).
I am trying to pass a pointer to a structure to a function.
This is the structure:
Code:
struct cavestruct {
int number;
int door[3];
bool visited;
} cave[200];
how would I pass this (either as a pointer or in its entirety) to another function?
ie. how would I change this (keeping the values already being passed)...
Code:
result=find_path(start_position, 79);
Maybe I should just leave it as a global variable...
P.S. To declare a pointer to an array of structures is it necessary to create an array of pointers or can I just declare one pointer to point at the address of the first element?
Thanks muchly...