Sorry, I don’t even know how to ask, since I am a complete newbie to C, pointers and the like. There's a function that takes an argument: char **arg. If I write this argument as follows:
char *cargs[] = {"blah", NULL};
and pass it to the function:
function(cargs);
it works. but ... I have NSArrayof NSStrings, and I need to make this array of values from NSArray. I decided that I needed to create a C array from the same element as NSArray, and copy the strings, converting them using cStringUsingEncoding. But I honestly have no idea how to do this, since I got confused with all these pointers and the like. Any help would be appreciated.
source
share