Forum: JRuby ffi and array

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C1623a8d4d3b7463a1963b5bd4cf0601?d=identicon&s=25 Fla As (fla)
on 2008-11-15 10:55
Hello,
how can I call this C function:
[code]
int** add_arr(int** array1, int** array2, int nrows, int ncols) {
  int i, j;
  int** res;
  res = allocate2D(nrows, ncols);
  for(i = 0; i < nrows; i++) {
    for(j = 0; j < ncols; j++) {
      res[i][j] =  array1[i][j] +  array2[i][j];
    }
  }
  return res;
}
[/CODE]
with Ruby-ffi?

Best regards
This topic is locked and can not be replied to.