I have a simple structure, loc
typedef struct
{
long blk;
int offset;
} loc;
In a function avl_isnadd, it is passed in as:
int
avl_isnadd (old_loc, old_isn, isn)
loc *old_loc;
int old_isn, isn;
{
int next_isn;
loc *this_loc;
printf("\n{avl_isnadd} - old_loc-> blk = %d, old_loc->offset = %d\n", old_loc->blk, old_loc->offset);
this_loc->blk = old_loc->blk;
this_loc->offset = old_loc->offset;
printf("\n{avl_isnadd} - this_loc->blk = %d, this_loc->offset = %d\n", this_loc->blk, this_loc->offset);
next_isn = avl_isnget (this_loc);
return next_isn;
}
and in avl_isnget, we have:
int
avl_isnget (myLoc)
loc *myLoc;
{
printf("\n{avl_isnget} - MyLoc->blk = %d, myLoc->offset = %d\n", myLoc->blk, myLoc->offset);
return 0;
}
The results on the console are:
{avl_isnadd} - old_loc-> blk = 1, old_loc->offset = 512
{avl_isnadd} - this_loc->blk = 1, this_loc->offset = 512
{avl_isnget} - MyLoc->blk = 1485457792, myLoc->offset = 512
What am I missing here? I don't see why avl_isnget should have a different value for myLoc->blk