sorry :P here it comes the whole program.
(actually not the whole. but I'm still working on this part.)
Code:
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
int main(){
int x,i,j,k,h,len,dr,index;
char guess;
char flt[9][20];
char* word;
FILE *sep;
sep=fopen("hangman.dat","r");
for(i=0;i<9;i++){
fgets(flt[i],20,sep);
}
fclose(sep);
srand( time(0) );
j=rand()%8+1;
word=flt[j];
len=strlen(word);
printf("%s",word);
while(true){
printf("Guess a letter:\n");
getchar();
scanf("%c",&guess);
for(k=0;k<len;k++){
if(guess==word[k]){
index=k;
for(i=0;i<len;i++){
if(i!=index)
printf("-");
else
printf("%s",word[index]);
}
}
}
}
return 0;
}