Values not stickin

Posted by Trom on Thu 05 Jan 2006 09:43 PM — 1 posts, 9,089 views.

#0
The problem is that i'm sending my char_data to a function that modifies the pc_data, the modifications don't carry through when the function is done doing the changes. The below is pseudo code to represent what is going on.

Note: i am using a 2d array to store the values in pcdata.



void somefunction( CH_DATA *ch ) {
ch->pcdata->value[0][0] = 1;
return;
}

ch->pcdata->value[0][0] = 0;
somefunction(ch);
printf("PcdataValue00: %d",ch->pcdata->value[0][0]);

// it would print "PcdataValue00: 0"

I'm going to work on it a bit more to see if anything new comes up but if you have any ideas, it would be appreciated.