if (RARRAY_LEN(arr) > 0)
{
VALUE str = rb_ary_entry(arr, 0);
abc = some_method(*str);
}
rb_ary_entry(arr, 0) gives me an index value. Then I want to convert that value to a string so I can pass it to the next method. I tried:
rb_str_new2(rb_ary_entry(arr, 0));
but I get error saying:
error: indirection requires pointer operand `('VALUE' (aka 'unsigned long')` `invalid`)`
`ipDict = some_method(*str)`;
Use the
StringValueCStrmacro to convert a Ruby String into achar*(therb_str_newfunctions are for converting in the other direction).