Filestream Out + move cursor back one place

This is a discussion on Filestream Out + move cursor back one place within the C++ Programming forums, part of the General Programming Boards category; Hey thank-you for looking, my 1st post, and I'm really stumped. I want to know if it is possible to ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    1

    Filestream Out + move cursor back one place

    Hey thank-you for looking, my 1st post, and I'm really stumped.

    I want to know if it is possible to move the filestream cursor back one space inside the file that I'm saving to. I have to save an array inside a for loop. This gives me a problem because I have to END each line of text in the file before starting the next line.

    e.g. (* represents where i would like the cursor to be after write)

    name
    age
    sex* - want cursor to finish here

    ==============================================
    This code below outputs this result

    name
    age
    sex
    * - at present cursor ends here


    for(int counter = 0; counter < 5; counter ++)
    {
    ArrayDataOutfile << customer[Int_counter].Char_Name << endl;
    ArrayDataOutfile << customer[Int_counter].Char_age << endl;
    ArrayDataOutfile << customer[Int_counter].Char_sex<< endl;
    }


    I am using MS visual c++ 6 and notepad files as output and input.

    Hope you can understand this problem, I'm really stuck and have been searching for ages for a fix.

    Thank-you very much in advance

    Regards

    h3lm3t

    8-)

  2. #2
    Gr3g
    Guest
    Hey,
    As i understand file steams the position of the end of file is determined by a pointert's value. off the top of my head i cannot rember the pointer name, but maybe this info will help.

    Gr3g

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle algorithm
    By PJYelton in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 08-05-2003, 11:28 AM
  2. Pathfinding AI? (Not the A* Algorithim)
    By harryP in forum C++ Programming
    Replies: 22
    Last Post: 08-01-2003, 03:32 PM
  3. Is there a bug in this part of my algorithm for connect 4?
    By Nutshell in forum Game Programming
    Replies: 8
    Last Post: 04-28-2002, 02:58 AM
  4. Berlin: Searching for a place to stay
    By fabs in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-14-2002, 02:18 AM
  5. Where is a good place to start?!
    By bobthefish3 in forum Game Programming
    Replies: 1
    Last Post: 10-09-2001, 12:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21