I'm attempting to create a program that can go through a wordsearch that can pick out horizontal and vertical words. There are 20 words to be found, and they can have a maximum string length of 16 characters. The puzzeboard itself is 16x16 array and is composed of characters only. I was thinking of doing something like this:

Code:
#include <stdio.h>

/*Maximum size for word search*/
#define MAXSEARCH 16
#define MAXWORDS  20

/*Function prototypes*/
void horizontal(char letters [MAXSEARCH][MAXSEARCH]);
void vertical(char letters [MAXSEARCH][MAXSEARCH]);



char wordsearch [MAXSEARCH][MAXSEARCH]={{'G','R','N','L','R','S','Y','S','T','E','M','E','E','O','M','R'},
                                        {'O','C','O','M','P','U','T','E','R','E','H','I','A','I','C','U'},
                                        {'R','A','I','M','P','R','O','G','R','A','M','A','N','R','R','R'},
                                        {'Q','M','E','M','O','R','Y','A','N','T','C','R','N','T','T','M'},
                                        {'L','A','O','N','E','T','W','O','R','K','R','O','H','H','E','U'},
                                        {'G','T','R','Y','S','T','R','I','N','G','I','A','E','G','Q','E'},
                                        {'R','R','R','N','E','A','N','Y','L','Y','I','L','E','E','U','R'},
                                        {'T','R','P','T','A','R','E','C','O','S','S','G','I','T','A','A'},
                                        {'R','T','P','L','A','R','N','A','G','O','M','E','R','B','T','U'},
                                        {'E','H','H','I','T','A','G','L','I','K','L','B','S','R','I','R'},
                                        {'N','E','Y','T','T','Y','I','C','C','M','C','R','M','I','O','O'},
                                        {'Y','O','S','R','A','H','N','U','U','G','R','A','E','D','N','A'},
                                        {'P','R','I','Y','O','R','E','L','C','U','U','C','A','G','S','R'},
                                        {'C','Y','C','G','E','K','E','U','R','S','S','B','A','E','L','S'},
                                        {'C','O','S','N','R','E','R','S','O','U','R','R','T','P','R','B'},
                                        {'C','N','P','O','C','N','R','M','R','U','A','I','G','A','S','O'}};

char words [MAXWORDS][MAXSEARCH]= {{'T','H','E','O','R','Y'},
                                   {'S','T','R','I','N','G'},
                                   {'A','R','R','A','Y'},
                                   {'A','P','P','L','E'},
                                   {'E','N','G','I','N','E','E','R'},
                                   {'C','O','M','P','U','T','E','R'},
                                   {'P','H','Y','S','I','C','S'},
                                   {'C','A','L','C','U','L','U','S'},
                                   {'A','L','G','E','B','R','A'},
                                   {'T','I','G','E','R'},
                                   {'B','R','I','D','G','E'},
                                   {'N','E','T','W','O','R','K'},
                                   {'P','R','O','G','R','A','M'},
                                   {'H','O','U','S','E'},
                                   {'E','Q','U','A','T','I','O','N'},
                                   {'M','E','M','O','R','Y'},
                                   {'S','L','E','E','P'},
                                   {'L','O','G','I','C'},
                                   {'S','Y','S','T','E','M'},
                                   {'P','I','A','N','O'}};

/*Main Function*/

int main() {
	
    int horizontalwords [MAXSEARCH*MAXSEARCH];
    int verticalwords   [MAXSEARCH*MAXSEARCH];
    int i=0;
    int j=0;

    printf("Copied by Rows");
    
    for (i=0;i<MAXSEARCH; i++) {
       for  (j=0;j<MAXSEARCH; j++) {
        
             horizontalwords[i]=wordsearch[i][j];
	     printf ("%s\n", horizontalwords[i]);		     
        }
    }
    
    printf("Copied by Columns");
    
    for (i=0;i<MAXSEARCH; i++) {
       for  (j=0;j<MAXSEARCH; j++) {
        
             verticalwords[i]=wordsearch[j][i];
	     printf ("%s\n", verticalwords[i]);		     
        }
    }
    
    
     
return 0;

}
That basically copies the array by columns and by rows into two separate matrices. The matrix with the columns copied into it will have all the vertical words. The matrix with the rows copied into it wil have all the horizontal words. My plan was to have two functions, one for the copied rows, and one for the copied columns, and for the functions to go thorugh the arrays and find the words, but im not to sure how to implement that. Any tips or sugestions would be appreciated!

-desi