i want to create an object of type QApplication which needs the main functions arguments argc and argv as an input:
QApplication app(argc, argv);
Since i am within a user defined function without access to the main function i want to define this arguments on my own. I have tried several approaches but i cannot get the type conversion right. My last approach did not work either:
int argc = 1;
char **argv;
char arguments[1][12] = {{"cgalExample"}};
argv = arguments;
Thanks for any hint.
Quick and dirty, but working for
QApplication:For a more complete and C standard conforming solution see D.Shawley’s answer.
Why your solution doesn’t work is simple:
array[i][j]results in ai*jmatrix. But what you actually want is an array with pointers to strings in it.