search for: r2cstr

Displaying 1 result from an estimated 1 matches for "r2cstr".

Did you mean: macstr
1999 Mar 25
1
.C and character
Hi, I had a problem passing characters from R into c-code by dyn.load() and .C(). test.c: void R2Cdouble(double *db) { printf("\n my double: %f \n", db[0]); } test.R: dyn.load("mylib.so"); .C("R2Cdouble", as.double(0.5)); worked fine, but test1.c: void R2Cstr(char *str) { printf("\n my char: %s \n", str[0]); } test1.R: dyn.load("mylib.so"); .C("R2Cdouble", as.character("test")); caused a segmentation fault (Linux 2.0.36, R-0.62.4). Is there a mechanism to do that? Torsten -.-.-.-.-.-.-.-.-.-.-.-.-.-....