blossompark
asked on
Error C2678: binary '!=': no operator found...
Hello all.
I'm doing some basic work with C++ streams on MS Visual Studio 2015, and I am encountering error C2678 when I attempt to compile this code:
For line 9, I receive this error output:
C2678 binary '!=': no operator found which takes a left-hand operand of type 'std::basic_istream<char,s td::char_t raits<char >>' (or there is no acceptable conversion)
Many thanks in advance!
I'm doing some basic work with C++ streams on MS Visual Studio 2015, and I am encountering error C2678 when I attempt to compile this code:
#include <iostream>
using namespace std;
int main()
{
char ch;
cout << "enter a phrase: ";
while ( cin.get(ch) != 0 )
{
if (ch == '!')
cin.putback('$');
else
cout << ch;
while (cin.peek() == '#')
cin.ignore(1, '#');
}
return 0;
}
For line 9, I receive this error output:
C2678 binary '!=': no operator found which takes a left-hand operand of type 'std::basic_istream<char,s
Many thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think that you can create your own account for free and ask your own questions for free. There is also a premium membership that gives you extra privileges.
ASKER
And, I'm actually borrowing this account at the moment. The DB questions aren't mine (though I hope to work my way through that subject as well!)
Many thanks.