In a console application, can I use cin to input character strings with space characters in them?

Joseph Klasen 146 Reputation points
2023-06-21T20:08:39.16+00:00

I have a novice question which didn't appear in the Q&A listing. In a console application, can I use CIN to input character strings that have space characters in them?

Developer technologies C++
{count} votes

Accepted answer
  1. didier bagarry 160 Reputation points
    2023-06-21T22:26:49.4433333+00:00

    You can read the whole line with std::getline( std::cin, string_variable );

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.