Help!!! Problems with arrays.
The following code is the game "The hangma"". The player guesses either a letter or the whole word. The program is working if the user inputs a letter, how can I do it if the user wants to input the whole word? Thanks a lot.
#include <stdio.h>
#include <string.h>
#define max_l 20
#define true_love 1
#define falsa 0
#define max_wrong_char 9
int main(void)
{
char c;
int i;
int j;
char *word;
char guess[max_l];
int len;
int found;
int wrong_char=0;
int rest;
// input word to guess
printf("imput word to guess\n ");
scanf("%s",word);
// word= toupper(*word);
// lenght of the word to guess
len=strlen(word);
for (i=0;i<len; i++) guess[i]='*';
// loop
for (wrong_char=0; wrong_char<max_wrong_char;)
{
// foun=falsa as default
found= falsa;
// display guess so far
for ( j=0; j<len; j++)
printf("%c", guess[j]) ;
// use inputs letrra
printf("\n input letter\n");
scanf("\n%c",&c);
// if la palabra es esncontrada
for (i=0;i<len;i++)
{
if (word[i]==c)
{
guess[i]=c;
found= true_love;
} //end if
}//end for
// if la palabra no es esncontrada
if (found==falsa)
{
wrong_char++;
rest= max_wrong_char-wrong_char;
printf(" Wrong letter - number of lifes %d\n ", rest);
}
if (rest==0)
printf("you are dead");
} // end of for para wrong
getch();
}