您好,我在我的 iPhone 应用程序中使用第 3 方库,它使用 C++ 我需要使用的方法之一返回指向类指针的指针。如下所示。
DLL classAttributes** getAttributes();
我可以成功调用该方法并将值返回到指向这样的指针的指针中;
classAttributes **attributes = cPPClass->getAttributes();
但是我似乎无法访问该类的任何方法,例如我知道该类有一个名为 getName() 的函数;但是当我尝试调用它时出现错误。
attributes->getName(); 'Request for member 'getName' in *attributes'; which is of non-class type 'attributes*''
我做了一些谷歌搜索,发现一些东西说访问指针指针地址使用格式
&(*attributes)->getName(); 'invalid uses of incomplete type 'struct attributes'
任何帮助将不胜感激。 谢谢。
最佳答案
'invalid uses of incomplete type 'struct attributes'
表示您需要为它#include
头文件。它仅在此时在您的代码中进行前向声明。
关于c++ - 在 C++ 中访问指向指针的指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3826481/