Can I safely cast a &char[] to char**?

Having the following code:

char data[2048];

And a function declared like this:

int f(char** data);

Can I safely call it like this:

f((char**)&data);

If I just use &data, the compiler issue the following warning:

warning C4047: 'function' : 'char **' differs in levels of indirection from 'char (*)[2048]'


Source: c#

Leave a Reply