Not sure how useful this will be to you, but I've got a lack-of-references work-around that might help you. In fixing stack for my card thingy:
struct stack_instance
{
int next[MAX_ITEMS]; // Next item in stack
int item[MAX_ITEMS]; // Card identity
int free; // First free item
}
stack_instance stack;
int ref_first; // First item
int ref_last; // Last item
int ref_count; // Count of items
Then to call functions:
StackConstructor();
ref_first = player.item_first;
ref_last = player.item_last;
ref_count = player.item_count;
StackPush(43);
StackPush(21);
player.item_first = ref_first;
player.item_last = ref_last;
player.item_count = ref_count;
Then in the function use as if you passed it:
void StackPush(int push_card)
// Add event to the stack
{
int push_this = stack.free; // Push item in first free slot
if (push_this == MAX_ITEMS) // If there are no free spaces in the array
exit("Stack overflow!"); // Exit with overflow error
stack.item[push_this] = push_card; // Sets the card
if (ref_last != MAX_ITEMS) // If this isn't the first item
stack.next[ref_last] = push_this; // Set previous next to new item
else
ref_first = push_this;
ref_last = push_this; // Set new item to last
stack.free = stack.next[push_this]; // Sets first free item to next free
stack.next[push_this] = MAX_ITEMS; // New last item points nowhere
ref_count++; // Increases item count
}
You could use this kind of method to pass/return anything you want - have one global array to dump/retrieve values.
Rar