-3

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.

enter image description here

Amit Jagesha シ
  • 1,092
  • 12
  • 21
  • The error in the picture(!) is quite clear. `sizeof` doesn't give you something that has an address. – Biffen Nov 27 '16 at 13:14
  • 1
    @πάντα ῥεῖ: this question might seem as a duplicate due to it's title but it has nothing to do with the post you had linked to... – Rok Jarc Nov 27 '16 at 13:16
  • 2
    @RokJarc Then its probably the OPs job to ask concise questions here. Feel free to vote for reopening. – πάντα ῥεῖ Nov 27 '16 at 13:17
  • right @RokJarc i know how to call c++ from objective c but unknown size_t* for me – Amit Jagesha シ Nov 27 '16 at 13:18
  • Check my answer below. You might have to tweak it a bit with type casting but it should give you a kick in the right direction. You might want to add signature of your getResult function to your question. – Rok Jarc Nov 27 '16 at 13:30

1 Answers1

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.

unsigned long sizeOfC = sizeof(c);
c->getResult(array1, &sizeOfC);
Rok Jarc
  • 18,765
  • 9
  • 69
  • 124