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

Discussion in 'C++' started by Paul, Jun 25, 2003.

  1. Paul

    Paul Guest

    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.
    Paul, Jun 25, 2003
    #1
    1. Advertising

  2. "MiniDisc_2k2" <> schrieb im Newsbeitrag
    news:KMjKa.22010$...
    [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
    Karl Heinz Buchegger, Jun 26, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S Guiboud
    Replies:
    1
    Views:
    408
    Ross Dempster
    Jul 18, 2003
  2. Tarun
    Replies:
    5
    Views:
    390
    Tarun
    Jul 14, 2005
  3. Phi!
    Replies:
    1
    Views:
    178
  4. malhenry

    input type=file does not always work

    malhenry, Mar 1, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    208
    Laurent Bugnion [MVP]
    Mar 1, 2007
  5. Replies:
    9
    Views:
    112
    matty
    Nov 20, 2005
Loading...

Share This Page