This is driving me crazy:
I have function
void gst_init(int *argc, char **argv[]);
in the gstreamer api and I want to call it with some parameters I define, like:
int argc = 2;
char* argv[2] = {"myvalue1", "myvalue2"};
gst_init(&argc, &argv);
This code doesn’t compile (I get error C2664):
error C2664: 'gst_init' : cannot convert parameter 2 from 'char *(*)[2]' to 'char **[]'
The question: How do I define the argv value to pass it as a parameter? I’ve been using C++ for over 5 years, but I haven’t used a raw array since … high-school I think (more than five years ago).
Edit: I’m using VS2010 Express.
Try
char **argv[]is an array ofchar**, which is analogous to an array ofchar*arrays.OTOH what you tried to pass as parameter is shown as
char *(*)[2]: a pointer to an array ofchar*.