Error in line 9, 10 and 13
“no operator found which takes a left-hand operand of type ‘std:istream’ (or there is no acceptable conversion'”
#include <stdafx.h> // I should have put #include "stdafx.h" instead
#include <iostream> // My mistake was I didn't #include <string>
using namespace std;
int main()
{
cout << "This is the left step bitwise operation\n";
string x;
cin >> x; // line 9
cout << "You typed" << x; //line 10
string y;
cout << "Enter second number please!";
cin >> y; // line 13
cin.get();
return 0;
} // line
My vague guess is that I didn’t #include something
You forgot to
#include <string>. Your code relies on that when you input a string, as well as when you declare it, and when you output it.I can’t take too much credit for this, so it’s a community wiki.