What is double star (eg. NSError **)?

后端 未结 5 560
旧时难觅i
旧时难觅i 2020-11-29 20:35

So, I saw this:

error:(NSError **)error

in the apple doc\'s. Why two stars? What is the significance?

5条回答
  •  日久生厌
    2020-11-29 21:07

    In C everything is pass by value. If you want to change the value of something you pass the address of it (which passes the value of the memory address). If you want to change where a pointer points you pass the the addres of the pointer.

    Take a look here for a simple explanation.

提交回复
热议问题