美文网首页
OC地址偏移-赋值

OC地址偏移-赋值

作者: 朱云哲 | 来源:发表于2019-03-12 23:46 被阅读0次

    NSInteger a = 1;

        NSIntegerb =2;

       NSInteger*c =  (&a -1);

        *c =3;

        NSLog(@"&a %p",&a);

        NSLog(@"&b %p",&b);

        NSLog(@"&c %p",&c);

        NSLog(@"&d %p",(&a -1));

        NSLog(@"a %zd",a);

        NSLog(@"b %zd",b);


    2019-03-12 23:30:59.627980+0800 Test-day1[64413:612081] &a 0x7ffee82859b8

    2019-03-12 23:30:59.628217+0800 Test-day1[64413:612081] &b 0x7ffee82859b0

    2019-03-12 23:30:59.628365+0800 Test-day1[64413:612081] &c 0x7ffee82859a8

    2019-03-12 23:30:59.628495+0800 Test-day1[64413:612081] &d 0x7ffee82859b0

    2019-03-12 23:30:59.628691+0800 Test-day1[64413:612081] a 1

    2019-03-12 23:30:59.628807+0800 Test-day1[64413:612081] b 3


    相关文章

      网友评论

          本文标题:OC地址偏移-赋值

          本文链接:https://www.haomeiwen.com/subject/sfkapqtx.html