ifstream

Discussion in 'C++' started by Michael Sgier, Jul 24, 2009.

  1. Hi
    I read in a simple text without any line feeds etc. So simply "TEST"
    But this code adds at the end, after TEST something. How can i avoid this?
    Many thanks
    Michael


    std::ifstream InPutfile1;

    InPutfile1.open(InFile, std::ios::in | std::ios::binary);
    while(!InPutfile1.eof() && !InPutfile1.fail())
    {
    char NewByte;

    Byte = InPutfile1.get();
    Michael Sgier, Jul 24, 2009
    #1
    1. Advertising

  2. Michael Sgier

    red floyd Guest

    Michael Sgier wrote:
    > Hi
    > I read in a simple text without any line feeds etc. So simply "TEST"
    > But this code adds at the end, after TEST something. How can i avoid this?
    > Many thanks
    > Michael
    >
    >
    > std::ifstream InPutfile1;
    >
    > InPutfile1.open(InFile, std::ios::in | std::ios::binary);
    > while(!InPutfile1.eof() && !InPutfile1.fail())
    > {
    > char NewByte;
    >
    > Byte = InPutfile1.get();


    I told you already.

    Please see FAQ 15.5

    http://www.parashift.com/c -faq-lite/input-output.html#faq-15.5
    red floyd, Jul 24, 2009
    #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. Giulio
    Replies:
    2
    Views:
    1,821
    Jon Bell
    Jun 24, 2003
  2. Dave Johnston

    ifstream([directory])

    Dave Johnston, Jul 7, 2003, in forum: C++
    Replies:
    2
    Views:
    3,100
    MiniDisc_2k2
    Jul 7, 2003
  3. John
    Replies:
    10
    Views:
    10,053
    Buster Copley
    Jul 14, 2003
  4. Rolf Magnus

    Re: shared ifstream

    Rolf Magnus, Jul 27, 2003, in forum: C++
    Replies:
    0
    Views:
    372
    Rolf Magnus
    Jul 27, 2003
  5. Gunnar

    ifstream.read manual

    Gunnar, Jul 27, 2003, in forum: C++
    Replies:
    2
    Views:
    8,794
    Jim Fischer
    Jul 28, 2003
Loading...

Share This Page