Le 07/10/10 22:04, Koert Kuipers a écrit :
Hello all,
I need to convert a std::string to a RAWSXP. I think i know hot do to this
without Rcpp. It goes something like this (i haven't tested this):
SEXP stringToRaw(std::string x) {
SEXP y;
PROTECT(y = allocVector(RAWSXP, x.length()));
memcpy(RAW(y
Hello all,
I need to convert a std::string to a RAWSXP. I think i know hot do to this
without Rcpp. It goes something like this (i haven't tested this):
SEXP stringToRaw(std::string x) {
SEXP y;
PROTECT(y = allocVector(RAWSXP, x.length()));
memcpy(RAW(y), x.data(), x.length());
UNPROTECT(1