This line ignores the rest of the current line, up to '\n'
or EOF
– whichever comes first:
'\n'
sets the delimiter, i.e. the character after whichcin
stops ignoringnumeric_limits<streamsize>::max()
sets the maximum number of characters to ignore. Since this is the upper limit on the size of a stream, you are effectively tellingcin
that there is no limit to the number of characters to ignore.
Related Contents:
- std::cin input with spaces?
- How do I flush the cin buffer?
- Why would we call cin.clear() and cin.ignore() after reading input?
- When and why do I need to use cin.ignore() in C++?
- How do I deal with the max macro in windows.h colliding with max in std?
- How to cin values into a vector
- if (cin >> x) – Why can you use that condition?
- Why does stringstream >> change value of target on failure?
- changing the delimiter for cin (c++)
- cin and getline skipping input [duplicate]
- Using getline(cin, s) after cin [duplicate]
- When should you use a class vs a struct in C++?
- What are POD types in C++?
- What does “dereferencing” a pointer mean?
- Where do I find the current C or C++ standard documents?
- .c vs .cc vs. .cpp vs .hpp vs .h vs .cxx [duplicate]
- Are global variables bad? [closed]
- How do I read an entire file into a std::string in C++?
- When to use inline function and when not to use it?
- Should I use static_cast or reinterpret_cast when casting a void* to whatever
- In practice, why would different compilers compute different values of int x = ++i + ++i;?
- C++ convert from 1 char to string?
- Should I return EXIT_SUCCESS or 0 from main()?
- std::array vs array performance
- Avoiding if statement inside a for loop?
- Qt Creator – Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild
- What is the difference between std::array and std::vector? When do you use one over other? [duplicate]
- Should the trailing return type syntax style become the default for new C++11 programs? [closed]
- C++ – Decimal to binary converting
- Why does the first element outside of a defined array default to zero?
- What is this (( ))?
- Output unicode strings in Windows console app
- C and C++ : Partial initialization of automatic structure
- Use of “this” keyword in C++ [duplicate]
- Refactoring with C++ 11
- Template Specialization VS Function Overloading
- How does this template code to get the size of an array work?
- Are “anonymous structs” standard? And, really, what *are* they?
- Overriding return type in function template specialization
- Why is inherited member not allowed?
- How to write a `for` loop over bool values (false and true)
- How does one iterate through an unordered set in C++?
- Serialization with Qt
- Converting a C-style string to a C++ std::string
- Memset Definition and use
- Why can’t static_cast be used to down-cast when virtual inheritance is involved?
- decltype and parentheses
- Are atomic variables lock-free?
- Is there a C++ equivalent to getcwd?
- Porting 32 bit C++ code to 64 bit – is it worth it? Why?