I want to call a C classes main function from within another class (which is written with objectiveC). I would like to pass some arguments to the main. I tried it like this, but the frist parameter gets ignored:
char *argv[] =
{
"--a",
"--b",
srcFile ,
destFile
};
my_c_main(4, argv);
Am I doing something wrong?
the first entry in the argv array is the application name itself. so if you want to pass arguments, skip the first entry and start your args at the second entry in the array. you could probably just use an empty string as the first array element.