The problem is as follows. I have a void pointer and I want to allocate string array with that. Is it possible to cast void* to char** like this:
void* ptr = (char**)calloc(size, sizeof(char*))
and then allocate each row of that table? I'm currently running out of ideas.
ptrhave the typevoid. (2) There is a missing).void*just points to any arbitrary chunk of memory.char **. Why do you want to usevoid *instead? Yu can do it, but it will be harder. Every time you do anything withptr, you'll have to cast it back tochar **.