Hello,

my problem is that I don't know how long must be an array of double while 
calling C from R.

R-Code:
> array <- c(1,1,1)
> save <- .C ( "Ctest" , a = array )

C-Code:
void Ctest ( double *array )
{ ...
  array = (double*) realloc ( array , new_number * sizeof(double) ) ;
  ...
}

The length of "array" will be compute in C.

At the end save$a has a length of 3 and not the length of the allocated array 
in C.

What can I do?

Thank you in advance.

Sven Knüppel

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to