Here is a code snippet I have written using c++ in turbo C++ IDE. The problem I am facing is after using gets(), cin is not working as it is skipping the inputs.Can someone possibly provide a solution to this issue. Here is the code snippet :-
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
int Resc()
{
char fName[10],lName[10],addr[100],usr[70],pass[20];
int d,y,m;
unsigned int phNo;
char *Gend;
clrscr();
cout<<"Enter First Name :"<<endl;
gets(fName);
cout<<"Enter Last Name :"<<endl;
gets(lName);
cout<<"Enter Gender :"<<endl;
gets(Gend);
cout<<"Enter Address:"<<endl;
gets(addr);
cout<<"Enter Date Of Birth (d/m/y):"<<endl;
cin>>d>>m>>y;
cout<<"Enter Phone Number :"<<endl;
cin>>phNo;
cout<<"Enter Username:"<<endl;
gets(usr);
cout<<"Enter Password:"<<endl;
gets(pass);
getch();
return 0;
}
It would be a great help. Thanks.