On 25 June 2009 at 17:39, Ivo Shterev wrote:
| Does anyone know how to pass a vector of strings, for example
"c("1", "2",
| "3") to a C++ function? Should the input argument to the C++
function be
| vector<string>*?
For the basic mechanics of making R and C/C++ talk, see the 'R
Extensions'
manual that came with your copy of R, or find it on CRAN.
For a higher level of abstraction, you may find my Rcpp package (on CRAN,
r-forge and at http://dirk.eddelbuettel.com/code/rcpp.html) useful. It does
indeed allow you to use c("1", "2", "3") as
vector<std::string> (after one
cast from RcppStringVector).
Dirk
--
Three out of two people have difficulties with fractions.