JosAugusto wrote:
> ------------------------------------------------
> 
> require 'inline'    # use Inline module
> 
> class Fake
> 
> inline_c_raw  %q[
> 
>     static VALUE newvar(int argc, VALUE *argv, VALUE self) {
>       VALUE temp;
> 
>       temp = rb_ary_new();
>       rb_ary_push(temp, rb_float_new(3.3));
>       rb_define_variable("$tempor", &temp);
>       rb_global_variable(&temp);
                           ^
This should have set of your alarm bells. Notice that you give in a
pointer to the VALUE (i.e. the container), which has local scope and is
gone after your C function returns.

Declaring temp as:

  static VALUE temp;

might help, but my C/C++ is rusty.

HTH

-- 
(\[ Kent Dahl ]/)_    _~_    __[ http://www.stud.ntnu.no/~kentda/ ]___/~
 ))\_student_/((  \__d L b__/  NTNU - graduate engineering - 5. year  )
( \__\_/__/ ) _)Industrial economics and technological management(
 \____/_\____/ (____engineering.discipline_=_Computer::Technology___)