From: elathan@... Date: 2004-01-08T18:46:21+09:00 Subject: Re: convert a C/C++ array to a Ruby array Quoting nobu.nokada@softhome.net: > > While writting a Ruby extension, consider the prototype: > > > > double * foo(void); > > > > I would like, optimally, to return a Ruby array with floats, but the > problem is that I don't know > > the length of the C array of doubles which foo() returns. > > How do you use it in C at all? Actually it is part of the functionallity a C++ Class embeds: Foo::Foo(int n, double *f); double * Foo::Get(); Okay, I can grab 'n' from the constructor and use it as the length of the Ruby/C array, but I wanted to make sure that there is no general way to procceed without messing with the details of the C/C++ code. Regards, Elias