Cin and Cout Objects

/* Here is a program that uses cout and cin objects.
*Its intentions is to display personal infomation of a user.
*This program uses one data type "if appropiate",which is below:
*
*string type.
*
*This code does'nt contain errors but it's not fullfilling its intentions.
*For instance,if you want to enter your fullname like Nigel Jaure,it will
*output Nigel only and inplace Jaure on the next variable( yourDob ).
*How do i enter details using spaces without inplacing to another variable?
*Author Name:Nigel Jaure(Novice C++ Programmer)
*/
#include <iostream>
using namespace std;

int main()
{
string yourName;
string your_date_birth;
string yourSex;
string yourId;
string yourAddress;
string yourWork;
string yourPos;
string cellNum;
string yourMail;

cout << "Enter Your Personal Details" << endl;
cout << " Enter Full Name :";
cin >> yourName;
cout << "Full Name: " << yourName << endl;
cout << "Enter Date Of Birth :";
cin >> your_date_of_birth;
cout << "Date Of Birth:" << your_date_of_birth << endl;
cout << "Enter Your sex :";
cin >> yourSex;
cout << "Sex:"<< yourSex << endl;
cout << "Enter Your ID Number :";
cin >> yourId;
cout << "I.D Number:" << yourId << endl;
cout << "Enter Your Address :";
cin >> yourAddress;
cout << "Address:" << yourAddress << endl;
cout << "Enter Your Workplace :";
cin >> yourWork;
cout << "Work:" << yourWork << endl;
cout << "Enter Your Position :";
cin >> yourPos;
cout << "Position:" << yourPos << endl;
cout << "Enter Your Cell Number :";
cin >> cellNum;
cout << "Cell Number:" << cellNum << endl;
cout << "Enter Your Email :";
cin >> yourMail;
cout << "Email:" << yourMail << endl;

cout << "THANK YOU" << endl;

cin.clear ();
cin.sync ();
cin.get ();

return 0;
}
Have you tried using gets( ), and puts( )?
How do i enter details using spaces without inplacing to another variable?

Use std::getline
http://www.cplusplus.com/reference/string/string/getline/
Thank you all,now working
Topic archived. No new replies allowed.