I finished writing a wordsearch program and it compiles without any errors or warnings. When I run the program, only the Print_Puzzle function displays output. The FIND and SEARCH function are no-where to be found. The FIND function should display where each word begins and ends. If the word is not found, it should display the default message... Thanx in advance...Hope thats descriptive enough for ya Quazh

Code:
#include <stdio.h>
#include <string.h>
#include <string.h>
#define WORDSEARCH "WordSearch.txt"//The puzzle
#define WORDLIST   "WordList.txt" //The list of Words
#define ROWS    15                 //# of Rows
#define COLS    15               //# of Columns

typedef struct 
{
    int row;
    int col;
} position;


//Declaring the Functions that are going to be used
void Print_Puzzle (FILE *wrdsearch ,FILE *wrdlist,char wordsearch[ROWS][COLS]);
int FIND (char grid[ROWS][COLS],char *word);
int SEARCH (char grid[ROWS][COLS],char *word,position *start,position *end);

int main ( ) 
{

    FILE *wrdlist; 
    FILE *wrdsearch;
    FILE *solutions;

    int i;
    int x;

    char wordtmp[80];  //Temp is to hold words from the WordList
    char *nptr;
    char grid[ROWS][COLS];

//Opening the WordSearch
 wrdsearch = fopen( WORDSEARCH , "r");
 if (!wrdsearch)
 {
  printf("File not Found");
  exit (0);
 }
//Opening the WordList        
wrdlist = fopen( WORDLIST , "r");
 if (!wrdlist)
 {
  printf("File not Found");
  exit (0);
 }

//Opening the Output
solutions = fopen( "output.txt" , "w");
 if (!solutions)
 {
  printf("File not Found");
  exit (0);
 }

    Print_Puzzle(wrdsearch,wrdlist,grid);
    fclose(wrdsearch);
    wrdsearch = NULL ;

    for ( i = 0; !(feof(wrdlist)); i++ )
    {
        fgets(wordtmp,sizeof wordtmp,wrdlist);

        if ( (nptr = strchr (wordtmp,'\n' ) ) != NULL )
        {
            *nptr = '\0';
            x = FIND ( grid, wordtmp );
        }
    }/* Strchr() returns a pointer to the first occurrence of character 
** located within s. If character c does not occur in the string, 
** strchr() returns a null pointer. */
    return 0;
}
//PRINTING OUT THE PUZZLE AND THE WORDS, CAN PRINT ANY SIZE PUZZLE
void Print_Puzzle(FILE *wrdsearch,FILE *wrdlist,char WordSearch[ROWS][COLS])
{
    int row , column, i;
    char WordList[80];

    printf("THE PUZZLE...size %i by %i\n", ROWS, COLS);
    printf("____________________________\n");
    for ( row=0 ; row < ROWS ; row++)
    {
        for( column = 0; column < COLS ; column++ )
        {
            fscanf(wrdsearch, "%c", &WordSearch[row][column]);
                if(WordSearch[row][column] == '\n' ||
                   WordSearch[row][column] == ' '     )
                {
                    column--;
                    continue;
                }
            printf("%c ", WordSearch[row][column]);
        }
        printf("\n");
    }   printf("\n\n\n");
    //PRINTING OUT THE WORDS 
    printf("The Words to Search For\n");
    printf("_______________________\n");
    for ( i = 0; !(feof(wrdlist)); i++ )
     {
        fscanf(wrdlist, "%s", WordList);
        printf("%s\n", WordList);
     }
}
// The find function searches a word recieved from main 
// Starting at each position in the grid
int FIND ( char grid[ROWS][COLS], char *word ) 
{
    int row,column;

    printf("The subscripts are by [across,vertical]\n\n\n");
    for ( row=0 ; row<ROWS ; row++ ) 
    {
        for ( column=0 ; column<COLS ; column++ ) 
        {
            position  start = { row, column };
            position  end;

            if ( SEARCH( grid, word, &start, &end ) ) 
            {
                printf( "%s starts at [%d,%d] and ends at [%d,%d]\n\n",
                    word, start.row, start.col, end.row, end.col );
                
                if ( !(SEARCH( grid, word, &start, &end )))
                    printf("%s IS NOT IN THE PUZZLE",word);

                return 0;
            }
        }
    }
    
    return 1;
}
// The Find Function sends SEARCH a start position and 
// Search will look for the word in 8 possible directions
int SEARCH (char grid[ROWS][COLS],char *word,position *start,position *end) 
{
    int row , column ;

    for ( row = -1 ; row <= 1 ; row++ ) 
    {
        for ( column = -1 ; column <= 1 ; column++ ) 
        {
            if ( row != 0 || column != 0 ) 
            {
                char *wrdp = word;
                     *end  = *start;

/* This While loop checks to see that the letters match 
** and that the end position is not out of the puzzle */
  while ( grid[end->row][end->col] == *wrdp &&
               end->row >= 0 && end->row < ROWS 
                             &&
               end->col >= 0 && end->col < COLS ) 
  {
                       wrdp++;
                    if ( *wrdp == '\0' )
                    {
                        return 1;                /* There is a match */
                    }
            /* This will check the next 
            ** position in the current
            ** direction for colums and rows */
                    end->col += column;  
                    end->row += row;             
  }
            }
        }
    }
    return 0;               /* The Word is not found / is not in Puzzle */
}
output:
Code:
THE PUZZLE...size 15 by 15
____________________________
Y P H W T E V S C T N A K Y O
E O O J N O S I O P M K C A B
X R V Y T D K J X M X F Y J H
D W Q Q T O G P O X T W X L B
Q Z M C H C D C Y M X B S Z D
Z E Z F Y U R A P G M W H O H
B T O P J E E L Y T U R O W W
O B V Y R Y L S A V W G R T Q
P H I S H J B Z L H N O T H V
G R J Q E E F A Z F H L Y S O
Z O G B H E Q E I U H L M G V
Y U M A B O F L B R P E B X Q
H K P R B R T J Z J I H Z K L
D S D P U E P H I K P S V W P
C X K Z R G V T X U Q G R V T



The Words to Search For
_______________________
HELLO
COMMA
FILTER
PHISH
POISION
TODAY
WORD
BACK
PUZZLE
SHORT
CREEP
RADIOHEAD