Please help me. I am completely confused at this memory address.
NSMutableArray *arr = [[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3", nil]; NSLog(@"Address of array = %p",&arr); NSLog(@"Array element Address = %p",arr); NSLog(@"Address 0th element %p",[arr objectAtIndex:0]); NSLog(@"Address of array =%lx",(long)&arr); NSLog(@"Array element Address = %lx",(long)arr); NSLog(@"Address 0th element %lx",(long)[arr objectAtIndex:0]); **Output** Address of array = 0xbfffd804 Array element Address = 0x866f340 Address 0th element 0x4748 Address of array =bfffd804 Array element Address = 866f340 Address 0th element 4748
I get this conclusion, but they confuse me with the second and third output, because, according to my knowledge, the second and third output should be the same. So please, anyone can explain to me. Thanks in advance.
source share