It's for an algorithm problem. I store the input in a and b then parse after and store the results on aa and bb The problem is only with the getline, if I'm not mistaken.
int n;
string a = "";
string b = "";
vector < int >aa, bb;
int i;
cin >> n;
int x = 0, y = 0;
int tot = 0;
cin.ignore();
// cout << endl;
cout << '1';
getline(cin, a);
cout << '2';
cout << a;
cout << '3';
It segfaults before printing '2', and I'm a bit clueless.
I've fixed that, however it has nothing to do with the segfault. It seems to happen in the getline statement, because when running the above code it prints '1', but not '2'.