On Sun, Jan 9, 2011 at 15:57, Thiago Silva <[email protected]> wrote:
> Hello,
>
> I was running through the docs and doing some experiments but couldn't
> find a way to convert an Array of Strings to char**.
A "CString new: 5" is an array of 5 strings (a pointer to 5 char*).
Something like
cstring at: 3 put: 'abc'
would fill the fourth pointer and automatically allocate memory for
the 'abc' string.
Note that CStrings can be a good source of memory leaks since you have
to free the elements as well.
> Somewhere I read
> that was possible to return an int** using "#(#ptr #{CInt})". I tried
> to pass #( 1 2 3) as parameter using this scheme but got "Attempt to
> pass an instance of Array as a void *".
No, Smaltalk objects are not automatically converted to instances from
the CObject hierarchy.
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk