About 10,900,000 results
Open links in new tab
  1. c++ - How does cin work? - Stack Overflow

    Apr 28, 2016 · cin is a blocked input. Whatever comes from the keyboard is stored in a buffer. When you press enter the system passes the buffer to the application code (std::cin code). Operator >> will …

  2. if (cin >> x) - Why can you use that condition? - Stack Overflow

    Jul 22, 2011 · cin is an object of class istream that represents the standard input stream. It corresponds to the cstdio stream stdin. The operator >> overload for streams return a reference to the same …

  3. What are the rules of the std::cin object in C++? - Stack Overflow

    Apr 30, 2009 · I am currently reading in with std::cin >> for the strings I expect to be single words and getline(std::cin, string) for the strings with spaces. I am not getting the right output, though.

  4. How to cin Space in c++? - Stack Overflow

    Using cin's >> operator will drop leading whitespace and stop input at the first trailing whitespace. To grab an entire line of input, including spaces, try cin.getline().

  5. What is the C equivalent to the C++ cin statement?

    Sep 16, 2010 · 3 There is no close equivalent to cin in C. C++ is an object oriented language and cin uses many of its features (object-orientation, templates, operator overloading) which are not …

  6. what is the cin operator order in C++ - Stack Overflow

    May 5, 2011 · That is, the very same is object (std::cin in our case) is then used to read into b: std::cin >> b. This invokes the same operator, which reads into b and then again return it's left operand.

  7. What is the best way to do input validation in C++ with cin?

    Dec 21, 2016 · Snag the input from std::cin using std::getline(std::cin, strObj) where strObj is a std::string object. Use boost::lexical_cast to perform a lexical translation from strObj to either a signed or …

  8. c++ - How does std::cin works? - Stack Overflow

    More correctly, cin reads from "standard input" (stdin). This may be the console, but it could also be a file or other device depending on the operator system and redirection by the user.

  9. What's going wrong in this c++ code which is using getline, cin, cin ...

    May 26, 2025 · This program is a part of my assignment; the assignment asked me to "Write a program demonstrating the difference between cin, getline(cin, std::string) and cin.getline(chararray, …

  10. c++ - cin.eof () functionality - Stack Overflow

    Feb 9, 2011 · I understand that cin.eof() tests the stream format. And while giving input, end of character is not reached when there is wrong in the input. I tested this on my MSV C++ 2010 and am not …