I need to allocate memory for a pointer which needs to be used as a 2d array.I know how to allocate memory for char pointers and int pointers I am confused how memory is allocated of a array of pointers.A pictorial representation of the reason would be very helpful,also is the code below fine?
char *names[5];
for(i=0;i<5;i++)
{
names[i]=(*char)malloc(sizeof(char));
}