only output is incorrect???

whenever i run this the only output i can get is incorrect even if it is correct


#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
string q1a;
string q1ca;
string q2a;
string q3a;
string q4a;
string q5a;
string q6a;

q1ca = "The purpose of presenting a motion is to bring an item of business before the chapter for consideration and action";

cout << "FFA Parlimentary Questions Preparation" << endl << endl;
cout << "Question 1" << endl << "What is the purpose of presenting a main motion?" << endl;
cin >> q1a;
getline(cin, q1a);
if (q1ca == q1a) { cout << "correct" << endl;

} else { cout << "incorrect" << endl;

}
}
Why are you using both operator>> and std::getline to read q1a from cin?
Topic archived. No new replies allowed.