What is the reason? Here the code on which the compiler swears.

char ** funcParam = { "eventId", "eventName" }; 

    2 answers 2

    Because char ** is a single pointer to a pointer, and what do you submit to the input?

    Need to

     char * funcParam[] = { "eventId", "eventName" }; 

    UPD: {"eventId", "eventName"} is an array of pointers, i.e. as if char * value [], i.e. many addresses, and char ** is just one pointer, one address in memory. Therefore, the message is.

    • You beat me for a second :) - Equinox
    • But I was minus for something ... - cy6erGn0m
    • I'm sorry, minus removed. Just at the time of my reading the code presented by you was identical to the code given in the question :) - AlexDenisov
    • I copied the code from the question and accidentally clicked to save .. and immediately recovered .. But I was caught on the fraud :) That's what is called the speed of light! Horror! :) - cy6erGn0m

    Most likely, this is not the only compiler error, he gave me another

     error C2440: 'initializing' : cannot convert from 'const char [8]' to 'char **' 

    What does it mean that the compiler cannot convert char [8], i.e. "eventId" to pointer to char.

    Rewrite the code, it works like this:

     char *funcParam[] = { "eventId", "eventName" };