Results 1 to 2 of 2

Thread: error c2678:binary'>>':no operator...

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2011
    Location
    wv
    Posts
    21

    error c2678:binary'>>':no operator...

    i am trying to learn c++. i have a decent understanding of visual basic, and bought a book, c++ primer plus and am trying to complete the exercises, but in chapter 5 i ran into a problem with loops adding user input. it is supposed to take the user input and add each number the user inputs until a 0 is input. the code i have is as follows:
    #include <iostream>
    int main()
    {
    using namespace std;
    int num;
    int total = 0;
    int x;
    cout << "Enter number: ";
    cin >> num;
    while (num != 0) { total = total + num;
    cout << total << endl;
    cin >> "Enter a number "; //this is where the error is: error c2678:binary'>>':no operator found which takes a left-hand operand of type 'std::istream'
    cin >> num;
    }
    cin.get();
    return 0;
    }
    i have used the cin statement and i'm sure this is the way the signs are supposed to point, and i even did std::cin >> "Enter a number "; to see if that was it. any help is appreciated.
    Last edited by sfzombie13; Feb 28th, 2013 at 11:50 AM. Reason: forgot full text of error message
    < advertising link removed by moderator >

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width