AnsweredAssumed Answered

Returning pointer to class(structure) field

Question asked by viktor_klochkov on Jul 17, 2014
Latest reply on Jul 21, 2014 by nou

Why I can't return pointer to class field?

 

class test{

public:

int* get_a () {return a;}

private:

  int a[2];

};

 

I have the error message:

 

"/tmp/OCL8Rwvmd.cl", line 30: error: type "__global int *" is not identical to

          nor covariant with return type "int *"

  int* get_a () {return a;}

                

"/tmp/OCL8Rwvmd.cl", line 30: error: type "__local int *" is not identical to

          nor covariant with return type "int *"

  int* get_a () {return a;}

Outcomes