I have a quick question that is been bugging me.
void
swap(void *a, void *b)
{
void *tmp;
tmp = a;
a = b;
b = tmp;
}
I wrote this intending it to be either able to swap a structure, or just the data defined within a structure.
Will the swap function be able to do this, because.. when i tested it, it seemed to fail. but i didnt except it too.
it should atleast work for swapping the data stored within the structure though, shouldnt it? (the data is of type event, which is shown below the heap struct).
** here are the structures **
struct heap_s
{
heap left, right;
void* data;
};
struct event_s {
etime time;
int e_num;
void (*event_fn)(event, pqueue);
void *details;
};