My spanish teacher made me do a word search and then I realized how much I hated them. I decided I would write my own(so there will probably be a lot of questions regarding coming up). I have some code that doesn't seach backwards yet and it only searches a one rowed file. Don't tell me how to do stuff like diagnols yet I think I can get them, but I use strstr to to find the word in the file. I was wondering how to take the pointer it returns and figure out how far into the array it is. heredon't worry about the row= part that is for later. Also if you want could you see if my fgets are safe. ThanxCode:#include <stdio.h> #include <string.h> #include <stdlib.h> int main(void){ char input[BUFSIZ],input2[BUFSIZ],file[BUFSIZ]; int row,x=0,y=0; char *retval; FILE *infile; printf("Enter the file with the words: "); fflush(stdout); fgets(input,sizeof input,stdin); input[strlen(input)-1]='\0'; infile=fopen(input,"r"); if(!infile){ fprintf(stderr,"Couldn't open file %s\n",input); exit(1); } printf("Enter the word to search for: "); fflush(stdout); fgets(input2,sizeof input2,stdin); input2[strlen(input2)-1]='\0'; fgets(file,sizeof file,infile); row=strlen(file); row--; printf("%i",row); retval=strstr(file,input2); if(retval==NULL) printf("Not in this row!\n"); else{ printf("In this row!!\n"); } return 0; }