I am just learning objective C and got an assignment to wrap C library to invoke via objective C. I am having trouble in passing character pointer array to c function. Basically i am invoking main method of c program via objective c but unable to pass arguments. Below is the function that i am trying to invoke from objective c:
int test_main( int argc, char *argv[] )
where argv is the command line arguments passed from console but now i want to pass those arguments from objective c code. Command line syntax of C program is : ./test -karg1 -larg2 -rarg3….
Please help me how can i invoke it via objective C (for sure i need to learn Pointer in C).
Regards,
MP
It is not too hard, and you do not need to know much about pointers:
Note that the initial argument (at position 0) is the name of the program. That is what C programs expect: their first “actual” argument is at position 1.