-3
printf("How many words to play with:");
scanf("%d",&end);
printf("How many letters to play with:");
scanf("%d",&let);
char a[let];
char b[let];
        while(i<end){
        ranW(let);
        printf("Word: %s\n:",a);
        gets(b);

        if (strcmp(a,b) == 0) {
            printf("Match\n");
            ++i;
        } else {
            printf("Do not match\n");
        }
    }

in part

    printf("Word: %s\n:",a);
    gets(b);

it just jumps to the next argument in the first loop and does not wait for input. But continues just fine in the other loops. I'm new on the site soo i coulnt post all my code if you need the rest i can provide it.

KilliBok
  • 3
  • 3

1 Answers1

0

After some research i used this code to solve the problems.

ranW(let, a);
printf("Word: %s\n",a);
fflush(stdin);
fgets(b,(sizeof b)+1 ,stdin);

I can still use advice if this is not right to use.

KilliBok
  • 3
  • 3