I have declared an array char **arr; How to initialize the memory for the 2D char array.
You might be better off with a one dimensional array:
char *arr = calloc(WIDTH*HEIGHT, sizeof(arr[0])); for (int y=0; y