4
I’m having problems with the gets function and fgets...
Always when I use them, the program skips the input, ie the user can not type the string, but it only works with scanf, just that I need to use the gets or fgets. I’ve used the function getchar(); whenever I use up let me type, but end up repeating, telling to record another again and again and again...  
Below is the code:
int main()
{
    char s1[20];
    char s2[20];
    int escolha = 1;
    printf("*****************************\n");
    printf("*Menu de opções para strings*\n");
    printf("*****************************\n\n");
    printf("Primeiro informe seu nome por favor: ");
    gets(s1);
    do
    {
        printf("\n(1) Quer saber o tamanho de seu nome?\n");
        printf("(2) Que tal comparar seu nome com outro nome?\n");
        printf("(3) Quer unir seu nome com outro nome?\n");
        printf("(4) O que acha de seu nome invertido?\n");
        printf("(5) Quer saber quantas vezes a mesma letra aparece em seu nome?\n");
        scanf("%d", &escolha);
        system("cls");
        switch(escolha)
        {
        case 1:
            printf("A quantidade de caracters de seu nome é: %d", strlen(s1));
            break;
        case 2:
            printf("Digite um novo nome para comparar: ");
            fgets(s2, 20, stdin);
            break;
        default:
            printf("Opção inválida");
        }
    } while(escolha);
    return 0;
}
getsis considered obsolete, insecure, ugly and poorly seen. Do not use it. At most usefgetspassing bystdinas an argument– Jefferson Quesado