cin >> carrots;
This line leaves a trailing newline token in the input stream, which then gets consumed by the next cin.get()
. Just do a simple cin.ignore()
directly before that:
cin.ignore();
cin.get();
More Related Contents:
- warning C4018: '<' : signed/unsigned mismatch [closed]
- I upgraded C++ projects from Visual Studio 2010 to 2015 still its showing Visual Studio (2010)
- Why does changing 0.1f to 0 slow down performance by 10x?
- Setup OpenCV-2.3 for Visual Studio 2010
- How to use Boost in Visual Studio 2010
- trap representation
- Macro for dllexport/dllimport switch
- Cannot find or open the PDB file in Visual Studio C++ 2010
- How do I start a CUDA app in Visual Studio 2010?
- error LNK2038: mismatch detected for ‘_MSC_VER’: value ‘1600’ doesn’t match value ‘1700’ in CppFile1.obj
- Linker error when calling a C function from C++ code in different VS2010 project
- Using AVX CPU instructions: Poor performance without “/arch:AVX”
- Mixing debug and release library/binary – bad practice?
- Using member variable in lambda capture list inside a member function
- M_PI works with math.h but not with cmath in Visual Studio
- Correct printf format specifier for size_t: %zu or %Iu?
- How to set breakpoint at the very beginning of program execution
- Heap Corruption while using CreateWindowExW
- in Visual Studio 2010 or 2008 [duplicate]
- C++ Fatal Error LNK1120: 1 unresolved externals
- How to run specific test cases in GoogleTest
- Static library debug symbols
- Visual Studio 2010 & 2008 can’t handle source files with identical names in different folders?
- The implementation of random_device in VS2010?
- Load resource as byte array programmaticaly in C++
- Using Visual Studio project properties effectively for multiple projects and configurations
- What is the meaning of `struct X typedef` vs. `typedef struct X`?
- Debug and Release Library Linking with CMAKE (VISUAL STUDIO)
- Differences between running an executable with Visual Studio debugger vs without debugger
- C++ static variable in .lib does not initialize