I'm afraid I am missing something.  In my R function (call it "foo", say) I
am doing something like 

     foo <- function() {
        ...
        .C("bar", ..., res=integer(n), ...)$res
    }

but I don't know the "n" to use; that is determined inside my C function
"bar".  Is there a way around this?  

I'm sorry to be thick on this.  Too many decades of C have made me love
pointers too much, I reckon.




Dirk Eddelbuettel wrote:
> 
> 
> You want R_alloc(). Here, "end of the call" is the call of the R function
> that calls your C function. This is what you want---the data will be
> available for the caller of your C code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/S_alloc-or-Calloc-for-return-value-tp24579062p24588176.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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