From: Yusuke Endoh Date: 2012-07-01T10:38:06+09:00 Subject: [ruby-core:46040] Re: How can i access ruby array element in C from ruby source code array.c? Hello, gmspro 2012/6/23 gmspro > So I have added couple of lines there to display the values of array. But > i didn't get the expected result. I recommend you to use: VALUE rb_ary_entry(VALUE, long) ary[0] (in Ruby) == rb_ary_entry(arr, 0) (in C) > Why is this result? Why 9? Because of the line: > � � � � result = LONG2NUM(s_arr[i]); You may want to use NUM2LONG, instead of LONG2NUM. LONG2NUM is mapping from C's long to Ruby's Integer. -- Yusuke Endoh