getline() doesn't end input

1
2
3
4
5
6
7
8
9
10
11
string str, temp;
    
char c;
    
cout << "Insert the character that ends the input:" << endl;
    
cin >> c;
    
cout << "Insert the string:" << endl;
    
getline(cin, str, c);


I should be able to put into the string "test" a string until I digit the ending char. But if I enter a double new line it doesn't recognize the ending char and it doesn't end the input:


Insert the character that ends the input:
}
Insert the string:
asdf

}
do it}
damn}
Topic archived. No new replies allowed.