C pointers vs. Objective-C pointers

前端 未结 7 1567
醉酒成梦
醉酒成梦 2021-02-06 05:37

I\'m coming from an Objective-C background and am trying to expand my knowledge in C. One thing has me confused, however, and that\'s the difference between pointers in C and O

7条回答
  •  悲&欢浪女
    2021-02-06 05:58

    In your first example, x and pointerX have different types ((int) and (int *) respectively). In your second example, string and stringPointer have the same type (NSString *). Try instead:

    NSString *string = @"Caramel coffee", **stringPointer;
    

提交回复
热议问题