the problem is when i run the program.. for the first structure it asks for the name.. from the next it skips of name input but asks for other field.Thus when the database is complete i gate just the first name but rest structures it remains empty... please run it if i am not clear...
hi .. i m sorry actually while copying i may have missed out.. but that wasn't the problem.. well i don't know if this way is good i found a new way...
The whole reason why you would use the getline() function is to pick up spaces. If I were to input the name "Jim" with just cin, this would work but if I were to give him a last name "Jim McTavish" then it would only take in "Jim" and ignore the space and everything after. With getline() you would get the whole name.
By using cin.ignore() I was able to get it working fine with your code and this adjustment.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.