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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    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>>theda ta;
    ....

    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.
  • Karl Heinz Buchegger

    #2
    Re: Input Operator &gt;&gt; Does not work in Visual C++ 6


    "MiniDisc_2 k2" <MattDelB@cox.n et> schrieb im Newsbeitrag
    news:KMjKa.2201 0$pH3.932@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
    kbuchegg@gascad .at


    Comment

    Working...