i want to create a program where user will give info as input to form their NID CARD.my program is ending just after taking the first input.i have also used %[^\n] instead of %s, but the same things happen.
#include <stdio.h>
struct DOB
{
int date;
char* month;
int year;
};
struct NID
{
char* name_bangla;
char* name_eng;
char* f_name;
char* m_name;
struct DOB s;
int ID;
};
int main()
{
struct NID my;
scanf(" %s", my.name_bangla);
fflush(stdin);
scanf(" %s", my.name_eng);
fflush(stdin);
scanf(" %s", my.f_name);
fflush(stdin);
scanf(" %s", my.m_name);
scanf("%d", &my.s.date);
scanf("%[^\n]", my.s.month);
scanf("%d", &my.s.year);
scanf("%d", &my.ID);
printf("name b : %s\n", my.name_bangla);
printf("Name : %s\n", my.name_eng);
printf("father : %s\n", my.f_name);
printf("mother : %s\n", my.m_name);
printf("DOB : %d/%s/%d\n", my.s.date,my.s.month,my.s.year);
printf("ID : %d", my.ID);
}