How do you know that j and len are referencing the same memory address?
Because they have the same contents?? That's not the way to test it. Try this:
if(&j == &len) ErrDisplay("Oh no...");
--- "J.J" <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I'm declare three variable in my function.
> One is ok, but two variable is reference same memory address.
>
> my code is below
>
> void test(char* strP)
> {
> int i, j, len = 0;
>
> for (i = 0; i < StrLen(strP); i++) <---- 1
> len++;
> for (j = 0; j < StrLen(strP); j++) <---- 2
> strP[j] = len;
> }
>
> this function is just test, but "j, len" is reference same address
>
> "len" value is length of "strP" when After the first "for" loop(1).
>
> But "len" value changed "0" when enter the second "for" loop(2) was
> initialized( j = 0).
>
> I'm not understand this situation...
>
> Why?????
>
> Please Help me...��
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/