Thank you. I can improve my program with your response but I have an other problem.
/double essai (double *Px, int *tailleP) { int i; for (i = 0; i < *tailleP; i++) { Px[i]=Px[i]*2; Rprintf ("I print Px %f\t", Px[i]); } Rprintf("\n"); return *Px; } void test_essai (double *Px, int *tailleP, double *res) { int i; *res = essai(Px, tailleP); for (i = 0; i < *tailleP; i++) { Rprintf ("I print res %f\t", res[i]); } }/ When I compile it in R /trajPx <- c(2,5,5,4) .C("test_essai",Px = as.numeric(trajPx),tailleP = as.integer(length(trajPx)),res = numeric(4))/ I have the following result: I print Px 4.000000 I print Px 10.000000 I print Px 10.000000 I print Px 8.000000 I print res 4.000000 I print res 0.000000 I print res 0.000000 I print res 0.000000 $Px [1] 4 10 10 8 $tailleP [1] 4 $res [1] 4 0 0 0 I haven't problem in "essai" function but I can't correctly return "Px" vector. I d'ont understand why I get only the first number (number 4 in my exemple) ? -- View this message in context: http://r.789695.n4.nabble.com/problem-when-I-Call-C-subfunction-in-void-function-tp4696073p4696103.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.