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);
Quick and dirty, but working for QApplication
:
char *argv[] = {"program name", "arg1", "arg2", NULL};
int argc = sizeof(argv) / sizeof(char*) - 1;
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 a i*j
matrix. But what you actually want is an array with pointers to strings in it.