Skip to content
Prev 2663 / 10988 Next

[Rcpp-devel] Pointer troubles

Hi Dirk (and list),

Yes, the above does help.
Although, I actually got the toy example to work about 5 minutes ago. :)
And just 1 minute ago also the OpenCL method. :D
At this moment I am a very happy person!

And for future reference I change the methods into this:
SEXP getIntPointer(){
    int *test = new int;
    *test = 6;
    SEXP retVal = int2EXP(test);
    int test2 = *SEXP2int(retVal);
    return retVal;
}

SEXP doubleIntPointer(SEXP test){
    int test2 = *SEXP2int(test);
    return Rcpp::wrap(test2*2);
}

Kind regards,

Willem
On Wed, Aug 3, 2011 at 14:03, Dirk Eddelbuettel <edd at debian.org> wrote: