Input Operator >> Does not work in Visual C++ 6

P

Paul

Hello,

I am a beginner programmer in Visual C++ 6 and have encountered a
problem.
I am trying to read from a text file in the following manner:
....
ifstream mystream;
mystream.open ("filename", ios:in);
mystream>>thedata;
....

I have checked all of my #includes and I do have fstream and iostream
yet I get the following error during compile:
"error C2678: binary '>>' : no operator defined which takes a
left-hand operand of type 'class ifstream' (or there is no acceptable
conversion)"

Here is a couple of interesting observations:
cin>>thedata; // does not compile either
however
cout<<somedata; //compiles with no problems

This is a dialog-based MFC application I am developing.

Any help on this matter would be great.
Thank you in advance,

Paul.
 
K

Karl Heinz Buchegger

[snip]

MiniDisc
Please refrain from MFC solutions in this newsgroup.
This NG is about standard C++ and how to use that.
No third party libraries since standard C++ is a big
enough topic on its own.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top