toString

Copies a string allocated in R from a character vector into a D string.

  1. string toString(Robj cstr)
  2. string toString(Robj sv, int ii)
    string
    toString
    (
    ,
    int ii
    )

Parameters

sv
Type: Robj

A character vector created in R and passed to D.

ii
Type: int

The index (starting at zero) holding the string to be copied into a D string.

Examples

# R code
titles = c("Chief Clown", "Chief Joker", "Chief Nut")
.Call("foo", titles)

// D code
Robj foo(Robj r_titles) {
 string d_title = toString(r_titles, 1); // Copies "Chief Joker" into title.
 . . .
}

See Also

Meta