Who modified my local variable?
Laurent R
rj45rt at hotmail.com
Mon Jun 12 01:58:00 MDT 2006
Hi,
I met a problem as show below:
void FunctionA(unsigned char *pLen)
{
*pLen = 16;
printf("T2 %d\r\n", *pLen);
return;
}
void FunctionB(void)
{
unsigned char ucLen = 0;
printf("T1 %d\r\n", unLen);
FunctionA(&ucLen);
printf("T3 %d\r\n", unLen);
return;
}
It is a multi-process project. One of the process will call FunctionB, but
the result is not 0->16->16. It is 0->16->0. There are several other
processes running in the backgroud. But there is no pre-empt process related
to this function, or re-entry call of this function. I don't know who modify
my local variable?
Who can help me to think out other reason to modify my local variable in
this example?
Br/Laurent
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
More information about the PLUG
mailing list