I believe this is a getline problem. I am trying to get a string in with a space. EX: getline(cin, fullname); I have about 4 of these getline functions. I use cin once to input a double and so I use cin.ignore() to clear the last getline. The problem occurs when I try to output this information. Some of the data is lost or outputed in the wrong spot for some reason. Have no clue why. Also the first getline function makes hit enter twice for it to take in the string i entered. This is for a friend or mine. thanks.
This program asks you questions and outputs the answers
Author: CPTR 212 Fall 2004 Class
using namespace std;
int loop = 1;
while (loop == 1)
cout << "\n Would you like to do it again?\n(1)Yes\n(2)No\n";
cin >> loop;
} //end while
} //end main
cout << "What is your name? ";
cout << "What is your favorite class? ";
cout << "What is your least favorite class? ";
cout << "What is your grade point average? ";
cin >> GPA;
cout << "Who is your favorite teacher? ";
cout << "Who is your least favorite teacher? ";
cout << "\nName: "
<< "Favorite Class: "
<< "Least Favorite Class: "
<< "Grade Point Average: "
<< "Favorite Teacher: "
<< "Least Favorite Teacher: "