Programming

Taking User Input Containing Spaces

In c++, many a times, you’d want to take a string as an input. But the default cin statement cannot accept spaces, i.e. it terminates the input when it encounters a space. For eg, if you input ‘Hello World’, only ‘Hello’ would be stored and rest all discarded. To overcome this, we have a function [...]