Skip to content
Prev 2727 / 10988 Next

[Rcpp-devel] integer arrays as arguments for a module function

Point taken: STL looks like the way to go in general.

In my particular example, however, the arrays get immediately cast to
another structure foo (somebody else's code).  So I need to cast from
IntegerVector to int[] before they get cast to foo[].  What you suggested
works perfectly (and makes sense in hindsight).

Is the story identical for char[]?  Where x is a CharacterVector, I tried

char* a = x.begin();

and got
error: cannot convert ?Rcpp::Vector<16>::iterator? to ?char*? in assignment

Any help much appreciated.
Chris
On Fri, Aug 12, 2011 at 3:19 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110812/303d974c/attachment-0001.htm>