This question already has an answer here:
这个问题在这里已有答案:
- Calling C++ method from Objective C 1 answer
从Objective C 1回答调用C ++方法
I want to call this function void getResult(char, size_t*) in objective c.How can i do this please help me. It give me below error show in image.
我想在目标c中调用此函数void getResult(char,size_t *)。如何帮助我。它给我下面的错误显示在图像中。
1 个解决方案
#1
1
It seems your getResult function expects to get second parameter by reference. You can't pass function result by reference. Assign it to actual variable first and then pass reference to that.
看来你的getResult函数希望通过引用得到第二个参数。您不能通过引用传递函数结果。首先将其分配给实际变量,然后将引用传递给它。
unsigned long sizeOfC = sizeof(c);
c->getResult(array1, &sizeOfC);
#1
1
It seems your getResult function expects to get second parameter by reference. You can't pass function result by reference. Assign it to actual variable first and then pass reference to that.
看来你的getResult函数希望通过引用得到第二个参数。您不能通过引用传递函数结果。首先将其分配给实际变量,然后将引用传递给它。
unsigned long sizeOfC = sizeof(c);
c->getResult(array1, &sizeOfC);