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

后端 未结 5 565
旧时难觅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:04

    In C, a double star is a pointer to a pointer. There are a couple of reasons to do this. First is that the pointer might be to an array of pointers. Another reason would be to pass a pointer to a function, where the function modifies the pointer (similar to an "out" parameter in other languages).

提交回复
热议问题