473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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.
Jul 19 '05 #1
1 3277

"MiniDisc_2k2" <Ma******@cox.net> schrieb im Newsbeitrag
news:KM*****************@news2.east.cox.net...
[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

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: leroybt.rm | last post by:
I don't understand why this does not work: <FILE1> test1.py #Import Packages import string # data=0 data=data+1
1
by: John H. Krueckeberg | last post by:
How does the macro operator ## work? For example, given a macro like this #define REGISTER_CLASS(_class, _symname) _class::MetaClass instance##_class(_symname); What would...
7
by: John M | last post by:
Can someone tell how to fix my visual c++ so it can discard this error message. I get this error message error C2593: 'operator >>' is ambiguous But I do not when I am on my mandrake linux...
3
by: Alex Vinokur | last post by:
Member operators operator>>() and operator<<() in a program below work fine, but look strange. Is it possible to define member operators operator>>() and operator<<() that work fine and look...
4
by: hall | last post by:
Hi all. I have run into a problem of overloading a templatized operator>> by a specialized version of it. In short (complete code below), I have written a stream class, STR, which defines a...
2
by: Bill | last post by:
I am trying to convert a Java APP to C# and it appears C# does not have a >>> operator. Does anyone the best way to conver this operator in to c#? Thanks. -- Bill
3
by: Bob | last post by:
What is an equivalent of a Right Shift operator (>>) in visual basic 6.0? I am trying to convert a C++ code into visual basic that looks like the following: While (m < n) { k = (m+n) >> 1 } ...
11
by: Noah Roberts | last post by:
template < typename T > std::istream & operator >(std::istream & in, std::pair<T,T& p) { in >p.first >p.second; return in; } .... std::istream_iterator< std::pair<size_type, size_type
3
by: Demoris | last post by:
I have a class that I believe should work. I've compared it to previous programs I've written, compared it to examples from my professor, to examples in my textbook, but can't see why I get the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.