Hi Coders!!!
I am developing a Bank Management System ..In one of its provided facility i.e.new account creation i am having problem with gets(name) .
Code Snippet:
Code:void account::create_account() { cout<<"\nEnter The account No."; cin>>acno; cout<<"\nEnter The Name of The account Holder :\n"; gets(name); cout<<"Your name is :"; puts(name); //for check purpose but got it empty every time cout<<"\nEnter Type of The account (C/S) : "; cin>>type; type=toupper(type); cout<<"\nEnter The Initial amount(>=500 for Saving and>=1000 for current ) : "; cin>> dep; while(type=='C' && dep<1000) { cout<<"Please enter amount >=1000"; cout<<"\n"; cin>>dep; } while(type=='S'&& dep<500) { cout<<"Please enter amount >=500"; cout<<"\n"; cin>>dep; } cout<<"\n\n\nAccount Created.."; cout<<"Good Luck :-)" ; }
The Problem is that when i runs this program it asks for other inputs except "name" which it skips i.e. the cursor even doesn't bother to get to the line and so did i am unable to give name.
Please suggest me the possible reason
thanks in ADVANCE