Top "Cin" questions

std::cin is the global stream object provided by the C++ standard library for reading from the standard input stream.

Basic String input

I've just came across this bit of code that allows users to input strings in the command prompt. I'm aware …

c++ string input getline cin
Check if string is in string (list of strings)

I'm new here and to C++. I've had some experience in python, and found "if a in b" really easy, …

c++ string if-statement input cin
Why does this work? Using cin to read to a char array smaller than given input

I'm reading C++ Primer Plus (6th Edition) and I've come across some sample code in chapter 4 which I have a …

c++ arrays char cin
How do I deal with the max macro in windows.h colliding with max in std?

So I was trying to get valid integer input from cin, and used an answer to this question. It recommended: #…

c++ iostream cin
std::cin skips white spaces

So I am trying to write a function to check whether a word is in a sentence, by looping through …

c++ cin spaces
how do I validate user input as a double in C++?

How would I check if the input is really a double? double x; while (1) { cout << '>'; …

c++ validation double cin
C++ - How do you loop back after user input?

In my previous question, I got this answer to work so that if the user inputs more than 5 characters in …

c++ loops if-statement cin iomanip
C++ Cin input to array

I am a beginner in c++ and I want to enter a string as character by character into an array , …

c++ arrays cin
Infinite loop with cin when typing string while a number is expected

In the following loop, if we type characters as the cin input instead of numbers which are expected, then it …

c++ validation infinite-loop cin
cin.getline() is skipping an input in C++

If I use the following code, getline doesn't take the last input(for last iteration of "for" loop, it simply …

c++ string getline cin