so I worked it out partially and I thought it should work, but my code isn't for some reason or another. here is my code as it stands.

Code:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
char fname[100];
char *p;
FILE *in_file;
 
void get_strings(FILE *fp){
 char str[100];
 char ch;
 char ch2;
 
 ch = fgetc(fp);
 while(ch != EOF){
  while(isprint(ch) != 0){
   strcpy(str,ch);
   ch2 = fgetc(fp);
   if(strlen(str) > 4 && isprint(ch2) == 0) {
    printf("%s \n",str);
    break;
   }
   else
    ch = ch2;
  }
  ch = fgetc(fp);
 }
}
 
int main(int argc, char *argv[])
{
 printf("Enter a filename: ");
 if(fgets(fname,sizeof(fname),stdin) != NULL){
  if((p = strchr(fname, '\n')) != NULL)
   *p = '\0'
 }
 in_file = fopen(fname, "r");
 if(in_file == NULL){
  printf("Cannot open %s \n", fname);
  exit(8);
 }
 get_strings(in_file);
}