Why scanf() functions won't getting input from user?
My code is as follows,


    typedef struct
    {
     char name[15];
     char country[10];
    }place_t;  
    
    int main()
     {
     int d;
     char c;
     place_t place;
     printf("\nEnter the place name : ");
     scanf("%s",place.name);
     printf("\nEnter the coutry name : ");
     scanf("%s",place.country);
     printf("\nEnter the type of the place : Metropolitan/Tourist (M/T)?");
     scanf("%c",&c);
     printf("You entered %c",c);
     return 0;
     }


If i run the program, it prompts for place name and country name. But it never wait for the character input from user and just printing empty value in output screen. I tried

    fflush(stdin);
    fflush(stdout);

Both wont work also.


Note : Instead of character, if I write code to get integer or float, it prompts for values. 

    printf("\nEnter the type of the place : Metropolitan/Tourist (M/T)?");
    scanf("%d",&d);

Why is this happening? Is there anything wrong with the code or whether the scanf getting values from buffer automatically? How to resolve this problem?

Why scanf() functions won't getting input from user?
===

My code is as follows,


    typedef struct
    {
     char name[15];
     char country[10];
    }place_t;  
    
    int main()
     {
     int d;
     char c;
     place_t place;
     printf("\nEnter the place name : ");
     scanf("%s",place.name);
     printf("\nEnter the coutry name : ");
     scanf("%s",place.country);
     printf("\nEnter the type of the place : Metropolitan/Tourist (M/T)?");
     scanf("%c",&c);
     printf("You entered %c",c);
     return 0;
     }


If i run the program, it prompts for place name and country name. But it never wait for the character input from user and just printing empty value in output screen. I tried

    fflush(stdin);
    fflush(stdout);

Both wont work also.


Note : Instead of character, if I write code to get integer or float, it prompts for values. 

    printf("\nEnter the type of the place : Metropolitan/Tourist (M/T)?");
    scanf("%d",&d);

Why is this happening? Is there anything wrong with the code or whether the scanf getting values from buffer automatically? How to resolve this problem?
