Skip to content

Instantly share code, notes, and snippets.

@metrafonic
Created December 11, 2014 08:02
Show Gist options
  • Select an option

  • Save metrafonic/77464f7c40e3aaeff3da to your computer and use it in GitHub Desktop.

Select an option

Save metrafonic/77464f7c40e3aaeff3da to your computer and use it in GitHub Desktop.
leshangman
int lesHangmanOrd(){
char tempOrd[30];
int i=0;
FILE * ordFil = NULL;
ordFil=fopen("Hangman.txt", "r");
do{
fscanf(ordFil, "%s", tempOrd);
strcpy(hangmanOrd[i], tempOrd);
i++;
}while(!feof(ordFil) && i<N);
fclose(ordFil);
if (i>1){
return i;
}else{
printf("ERROR: Feil i ordlisten\n");
return -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment