Error c2678

Ok, so I have researched and researched and have been through my code dozens of times, and I can not seem to figure out why I keep getting:

error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::istream'

here's a snippet of my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "ItemType.h"

void ItemType::addListing(ofstream& output) const
{
	output.open("prgmlisting.dat");

	if(!output.is_open())
		cout << "sorry cannot open file!" << endl;
	else
		{
			cout << "please enter name of channel: ";
			cin >> channel; //This is where I keep getting the error
			output << channel << endl;
		}
}
Continue reading...
¿what is channel?

@ne555
¿what is channel?


If to remove one 'n' then it will be perfume Chanel.:)
To use the operator, you must overload it for the specified type or define a conversion to a type for which the operator is defined.

C2678 can occur if you do not pin a native member before calling a member function on it.

http://msdn.microsoft.com/en-us/library/ys0bw32s(v=vs.80).aspx
Topic archived. No new replies allowed.