So I have some code like
This won't compile. I tried myfunc((char *[])foo); but that wouldn't compile either. I could only get it to compiile with myfunc((char **)foo);. But this doesn't run because the the value at val[0] gets treated like a pointer. So I tried val[0][0], but the same thing happened.Code:static void myfunc(char * val[]) { if(*(val[0]) == 'x') //do stuff } char foo[30][30]; //populate foo myfunc(foo);
Is this because I'm casting to char ** when I pass it?




Reply With Quote