Which function is used to take string input with spaces and also function to clear input buffer in c++? | SoloLearn: Learn to code for FREE!

+1

Which function is used to take string input with spaces and also function to clear input buffer in c++?

c++ c

5/26/2020 7:14:28 AM

Gaurav Rawat

1 Answer

New Answer

+2

I think you want std::getline() And maybe see std::cin.ignore() http://www.cplusplus.com/reference/string/string/getline/ http://www.cplusplus.com/reference/istream/istream/ignore/ https://www.google.com/amp/s/www.geeksforgeeks.org/clearing-the-input-buffer-in-cc/amp/