very complicated. help?

Whenever I try to input the birthday in this form- october 10 17 1998, the word october will be lost same goes for the name and course. First words were omitted. Btw, I am using Dev C++

#include <iostream>
#include <conio.h>
#include <string>
using namespace std;

int main ()
{
string name = "";
int age;
age = 0;
string birthday = "";
string course = "";

cout <<"Enter name: ";
cin >>name;
getline (cin,name);

cout <<"Enter age: ";
cin >>age;

cout <<"Enter birthday: ";
cin >>birthday;
getline (cin,birthday);

cout <<"Enter course: ";
cin >>course;
getline (cin,course);

cout <<"\n\nStudent Profile: \n\n";

cout <<"Name: "<<name<<" \n";
cout <<"Age: "<<age<<" \n";
cout <<"Birthday: "<<birthday<<" \n";
cout <<"Course: "<<course<<" \n";

getch (;
}
Please use code tags to improve readability.

The problem with your code is that you're reading in the name, birthday and course twice each.
1
2
cin >>course;
 getline (cin,course);
Both of these are read, so some info is lost. Choose just one to keep.
Topic archived. No new replies allowed.