Search:

Type: Posts; User: Daved

Search: Search took 0.08 seconds.

  1. Replies
    10
    Views
    55,690

    My original advice was to put cin.ignore() after...

    My original advice was to put cin.ignore() after all calls to cin >>. That's different than putting it before calls to getline. Make sure you follow the original advice and you won't have any...
  2. Replies
    10
    Views
    55,690

    That's the behavior that occurs if you're missing...

    That's the behavior that occurs if you're missing the line in red in my example. Did you add cin.ignore(); after every call to cin >>?

    There is a bug in an old version of Visual C++ that shows the...
  3. Replies
    10
    Views
    55,690

    #include #include int...

    #include <iostream>
    #include <string>

    int main()
    {
    std::string name;
    std::cout << "What is your full name: ";
    std::getline(std::cin, name);

    int age = 0;
  4. Replies
    10
    Views
    55,690

    Note that if you use cin >> to read in the ID...

    Note that if you use cin >> to read in the ID number or any other entry, and also use getline, you will get strange results. Mixing the two forms of input can cause problems because cin >> leaves the...
Results 1 to 4 of 4