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...h�)ߢ���*'�{��x-��ږ`޽�h��Ţ�������칻�&ަW���zm����
Z�j,r��u����!�˩�����+�k?


Reply via email to