From: ts Date: 2002-02-07T21:28:21+09:00 Subject: Re: API questions >>>>> "A" == Andy Neagu writes: A> How can I know the size of an ruby array? RARRAY(ary)->len A> STR2CSTR makes a copy? Or gets only a pointer to? STR2CSTR call rb_str_to_str() (which call #to_str) is the object is not a String, then it return RSTRING(str)->ptr A> If I want to pass to a function a pointer array of C strings and the strings A> are in a ruby array of strings, how can I do?? RARRAY(ary)->ptr give you a C pointer on VALUE For example, if you have only Strings in the Array for (i = 0; i < RARRAY(ary)->len; i++) { rb_warn("String %s", RSTRING(RARRAY(ary)->ptr[i])->ptr); } Guy Decoux