Q:

Printing 2D char array in C

I have a 2D array of chars
char** words;//2D array where each slot holds a word.
char word [ MAX_WORD ]; 

And I am trying to do a ridiculously simple thing. I need to print the array so I see that I allocated memory right and removed all the newline characters.
Here is what I am trying to do
//print array
int k, j;
for (k = 0; k < MAX_WORD ; k++) {
    for (j = 0; j < NUMWORDS; j++) {
        printf("%s%s", words[k],words[j]);
    }
    printf("\n");
}

And this is what I get
�Ð���������������=����Ð���������������=����Ð���������������=���  
Segmentation fault: 11

I don't have any warnings or compiled errors. I think my problem might be that I am trying to print out a memory address instead of the actual char, or my malloc didn't do what I expected it to do.
This is my first program in C and so far this language pains me in the most uncomfortable way.
This is how I allocate memory for words array
words = (char**) malloc(sizeof(char*)*NUMWORDS);

And then I fill it with words I get from a file input. I malloc for each words while I get the input, store each word at a word array address and then remove \n. I print each word out, so it works.

A:

You allocate memory for words as

words = (char**) malloc(sizeof(char*)*NUMWORDS);

What is done by you is allocate memory for each words pointer, but address where character sit was not allocated. So you can done this by a loop
for(int i=0; i<NUMWORDS; i++)
{
    words[i] = (char*)malloc(sizeof(char)*MAX_WORD);
}

Your print segment has also some fault, here code I have tried, may be what you wanted.
    char **words;
    words = (char**)malloc(sizeof(char*)*NUMWORDS);
    for(int i=0; i<NUMWORDS; i++)
    {
        words[i] = (char*)malloc(sizeof(char)*MAX_WORD);
    }
    strcpy(words[0], "Hello world");
    strcpy(words[1], "Hi how are you?");
    char word[MAX_WORD];
    int k, j;
    for (k = 0; k < NUMWORDS ; k++)
    {
        for (j = 0; words[k][j]!='\0'; j++)
        {
            printf("%c", words[k][j]);
        }
        printf("\n");
    }

For Good practice you can declare two dimensional array like 
 char words[NUMWORDS][MAX_WORD];

Or
char *words[NUMWORDS];

And allocate memory for all words by a loop. As your NUMWORDS and MAX_WORD is constant.

