i am having a problem in c++ program (its my school project).
in this program i have to input the details from the user but here a after entering the name it goes to infinite loop in function input and it in not doing cin please help: struct employ{ char code,name; int d,m,y; }e[5]; void input(){ for(int i=0;i<5;i++){ cout<<"employ "<<i+1<<" enter your data"; cout<<"enter your name"<<endl; cin>>e[i].name; cout<<"enter code"<<endl; cin>>e[i].code; cout<<"enter your date of joining of job in ddmmyyyy"<<endl; cin>>e[i].d>>e[i].m>>e[i].y; } } void display(){ for(int i=0;i<5;i++){ cout<<"data of "<<i+1<<" employ"<<endl; cout<<"name: "<<e[i].name<<endl; cout<<" code: "<<e[i].code<<endl; cout<<" date of joining"<<e[i].d<<e[i].m<<e[i].y; } } void main(){ clrscr(); char x,code1; int ch,a,j,i,d1,m1,y1; double n[5],n1,l,l1,yoj[5]; a=1; while(a!=0){ cout<<"1.input the data"<<endl; cout<<"2.display all data"<<endl; cout<<"3.exit"<<endl; cout<<"enter choice 1 or 2 or 3"<<endl; cin>>ch; switch(ch){ case 1: input(); break; case 2: display(); break; case 3: break; } cout<<"do you want to continue 1 for yes or 0 for no"; cin>>a; } getch(); }